mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 03:11:09 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user