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
+5 -3
View File
@@ -34,10 +34,12 @@
# #
################################################################################
from __future__ import absolute_import
import github.GithubObject
import github.NamedUser
import Consts
from . import Consts
import six
class PullRequestComment(github.GithubObject.CompletableGithubObject):
@@ -184,7 +186,7 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject):
:param body: string
:rtype: None
"""
assert isinstance(body, (str, unicode)), body
assert isinstance(body, (str, six.text_type)), body
post_parameters = {
"body": body,
}
@@ -216,7 +218,7 @@ class PullRequestComment(github.GithubObject.CompletableGithubObject):
:param reaction_type: string
:rtype: :class:`github.Reaction.Reaction`
"""
assert isinstance(reaction_type, (str, unicode)), "reaction type should be a string"
assert isinstance(reaction_type, (str, six.text_type)), "reaction type should be a string"
assert reaction_type in ["+1", "-1", "laugh", "confused", "heart", "hooray"], \
"Invalid reaction type (https://developer.github.com/v3/reactions/#reaction-types)"