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
+6 -4
View File
@@ -31,9 +31,11 @@
# #
################################################################################
from __future__ import absolute_import
import github.GithubObject
import github.HookResponse
import six
class Hook(github.GithubObject.CompletableGithubObject):
@@ -153,11 +155,11 @@ class Hook(github.GithubObject.CompletableGithubObject):
:param active: bool
:rtype: None
"""
assert isinstance(name, (str, unicode)), name
assert isinstance(name, (str, six.text_type)), name
assert isinstance(config, dict), config
assert events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events
assert add_events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_events), add_events
assert remove_events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_events), remove_events
assert events is github.GithubObject.NotSet or all(isinstance(element, (str, six.text_type)) for element in events), events
assert add_events is github.GithubObject.NotSet or all(isinstance(element, (str, six.text_type)) for element in add_events), add_events
assert remove_events is github.GithubObject.NotSet or all(isinstance(element, (str, six.text_type)) for element in remove_events), remove_events
assert active is github.GithubObject.NotSet or isinstance(active, bool), active
post_parameters = {
"name": name,