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:
Steve Kowalik
2019-08-05 14:06:19 +10:00
committed by GitHub
parent f1ae7200ba
commit dc2f2ad8cb
182 changed files with 850 additions and 629 deletions
+5 -3
View File
@@ -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,