mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Switch to using six (#1189)
With the Python 2.7 deadline fast approaching, modernize the codebase making use of the modernize module to switch to using six, as well as other upcoming features, such as absolute imports . Stop using 2to3 for Travis, yay!
This commit is contained in:
+5
-3
@@ -30,6 +30,7 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
from __future__ import absolute_import
|
||||
import datetime
|
||||
|
||||
import github.GithubObject
|
||||
@@ -37,6 +38,7 @@ import github.PaginatedList
|
||||
|
||||
import github.NamedUser
|
||||
import github.Label
|
||||
import six
|
||||
|
||||
|
||||
class Milestone(github.GithubObject.CompletableGithubObject):
|
||||
@@ -170,9 +172,9 @@ class Milestone(github.GithubObject.CompletableGithubObject):
|
||||
:param due_on: date
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(title, (str, unicode)), title
|
||||
assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert isinstance(title, (str, six.text_type)), title
|
||||
assert state is github.GithubObject.NotSet or isinstance(state, (str, six.text_type)), state
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, six.text_type)), description
|
||||
assert due_on is github.GithubObject.NotSet or isinstance(due_on, datetime.date), due_on
|
||||
post_parameters = {
|
||||
"title": title,
|
||||
|
||||
Reference in New Issue
Block a user