Skip to content
Snippets Groups Projects
Commit de7bdb0e2a95 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

py3: suppress DeprecationWarning about deprecated base64 module aliases

base64.encodestring() / base64.decodestring() were renamed to
base64.encodebytes() / base64.decodebytes() in Python 3. The old names still
worked, but raised a DeprecationWarning.
parent 0c27d981131a
No related branches found
No related tags found
No related merge requests found
......@@ -84,5 +84,13 @@
return l
if pycompat.ispy3:
base64_encodebytes = base64.encodebytes
base64_decodebytes = base64.decodebytes
else:
base64_encodebytes = base64.encodestring
base64_decodebytes = base64.decodestring
def encodeargs(args):
def encodearg(s):
......@@ -87,6 +95,6 @@
def encodeargs(args):
def encodearg(s):
lines = base64.encodestring(s)
lines = base64_encodebytes(s)
lines = [l.splitlines()[0] for l in pycompat.iterbytestr(lines)]
return b''.join(lines)
......@@ -95,7 +103,7 @@
def decodeargs(s):
s = base64.decodestring(s)
s = base64_decodebytes(s)
return pickle.loads(s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment