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
+7 -5
View File
@@ -30,9 +30,11 @@
# #
################################################################################
from __future__ import absolute_import
import github.GithubObject
import github.AuthorizationApplication
import six
class Authorization(github.GithubObject.CompletableGithubObject):
@@ -135,11 +137,11 @@ class Authorization(github.GithubObject.CompletableGithubObject):
:param note_url: string
:rtype: None
"""
assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes
assert add_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_scopes), add_scopes
assert remove_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_scopes), remove_scopes
assert note is github.GithubObject.NotSet or isinstance(note, (str, unicode)), note
assert note_url is github.GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url
assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, six.text_type)) for element in scopes), scopes
assert add_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, six.text_type)) for element in add_scopes), add_scopes
assert remove_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, six.text_type)) for element in remove_scopes), remove_scopes
assert note is github.GithubObject.NotSet or isinstance(note, (str, six.text_type)), note
assert note_url is github.GithubObject.NotSet or isinstance(note_url, (str, six.text_type)), note_url
post_parameters = dict()
if scopes is not github.GithubObject.NotSet:
post_parameters["scopes"] = scopes