Remove more Python version specific code (#1193)

Remove a bunch of other call sites that behaved differently between
Python 2 and 3, massively cleaning up a few messy methods.
This commit is contained in:
Steve Kowalik
2019-08-28 15:24:54 +10:00
committed by GitHub
parent 7bac694ae5
commit a0f01cf9cf
9 changed files with 44 additions and 94 deletions
+1 -4
View File
@@ -53,7 +53,6 @@ import datetime
import pickle
import time
import sys
import requests
import jwt
import urllib3
@@ -78,8 +77,6 @@ from . import Invitation
from . import Consts
import six
atLeastPython3 = sys.hexversion >= 0x03000000
DEFAULT_BASE_URL = "https://api.github.com"
DEFAULT_STATUS_URL = "https://status.github.com"
# As of 2018-05-17, Github imposes a 10s limit for completion of API requests.
@@ -731,7 +728,7 @@ class GithubIntegration(object):
algorithm="RS256"
)
if atLeastPython3:
if isinstance(encrypted, bytes):
encrypted = encrypted.decode('utf-8')
return encrypted