We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 58442fb + fc12e89 commit 9975866Copy full SHA for 9975866
jose/jwk.py
@@ -4,8 +4,7 @@
4
import hmac
5
import struct
6
import six
7
-
8
-from builtins import int
+import sys
9
10
import Crypto.Hash.SHA256
11
import Crypto.Hash.SHA384
@@ -28,6 +27,11 @@
28
27
else:
29
_RSAKey = RSA.RsaKey
30
+# Deal with integer compatibilities between Python 2 and 3.
31
+# Using `from builtins import int` is not supported on AppEngine.
32
+if sys.version_info > (3,):
33
+ long = int
34
+
35
36
def get_algorithm_object(algorithm):
37
"""
@@ -65,7 +69,7 @@ def get_algorithm_object(algorithm):
65
69
66
70
67
71
def int_arr_to_long(arr):
68
- return int(''.join(["%02x" % byte for byte in arr]), 16)
72
+ return long(''.join(["%02x" % byte for byte in arr]), 16)
73
74
75
def base64_to_long(data):
0 commit comments