mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +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:
@@ -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)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user