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
@@ -37,6 +37,7 @@
# #
################################################################################
from __future__ import absolute_import
import datetime
import github.GithubObject
@@ -49,6 +50,7 @@ import github.Permissions
import github.Plan
import github.Organization
import github.Event
import six
class NamedUser(github.GithubObject.CompletableGithubObject):
@@ -536,7 +538,7 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
:param name: string
:rtype: :class:`github.Repository.Repository`
"""
assert isinstance(name, (str, unicode)), name
assert isinstance(name, (str, six.text_type)), name
headers, data = self._requester.requestJsonAndCheck(
"GET",
"/repos/" + self.login + "/" + name
@@ -552,9 +554,9 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
:param direction: string
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
"""
assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type
assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort
assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction
assert type is github.GithubObject.NotSet or isinstance(type, (str, six.text_type)), type
assert sort is github.GithubObject.NotSet or isinstance(sort, (str, six.text_type)), sort
assert direction is github.GithubObject.NotSet or isinstance(direction, (str, six.text_type)), direction
url_parameters = dict()
if type is not github.GithubObject.NotSet:
url_parameters["type"] = type