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:
+8
-6
@@ -31,11 +31,13 @@
|
||||
# #
|
||||
################################################################################
|
||||
|
||||
import urllib
|
||||
from __future__ import absolute_import
|
||||
import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error
|
||||
|
||||
import github.GithubObject
|
||||
|
||||
import Consts
|
||||
from . import Consts
|
||||
import six
|
||||
|
||||
|
||||
class Label(github.GithubObject.CompletableGithubObject):
|
||||
@@ -96,9 +98,9 @@ class Label(github.GithubObject.CompletableGithubObject):
|
||||
:param description: string
|
||||
:rtype: None
|
||||
"""
|
||||
assert isinstance(name, (str, unicode)), name
|
||||
assert isinstance(color, (str, unicode)), color
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description
|
||||
assert isinstance(name, (str, six.text_type)), name
|
||||
assert isinstance(color, (str, six.text_type)), color
|
||||
assert description is github.GithubObject.NotSet or isinstance(description, (str, six.text_type)), description
|
||||
post_parameters = {
|
||||
"name": name,
|
||||
"color": color,
|
||||
@@ -115,7 +117,7 @@ class Label(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
@property
|
||||
def _identity(self):
|
||||
return urllib.quote(self.name)
|
||||
return six.moves.urllib.parse.quote(self.name)
|
||||
|
||||
def _initAttributes(self):
|
||||
self._color = github.GithubObject.NotSet
|
||||
|
||||
Reference in New Issue
Block a user