We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17880b6 commit 3d5d52fCopy full SHA for 3d5d52f
1 file changed
oauth2/_compat.py
@@ -3,8 +3,14 @@
3
except NameError: #pragma NO COVER Py3k
4
TEXT = str
5
STRING_TYPES = (str, bytes)
6
+ def b(x, encoding='ascii'):
7
+ return bytes(x, encoding)
8
else: #pragma NO COVER Python2
9
STRING_TYPES = (unicode, bytes)
10
11
+ if isinstance(x, unicode):
12
+ x = x.encode(encoding)
13
+ return x
14
15
def u(x, encoding='ascii'):
16
if isinstance(x, TEXT): #pragma NO COVER
0 commit comments