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