Commit 2ebe821e authored by Tiago Peixoto's avatar Tiago Peixoto

Fix pickling with python3

parent 5d76bbb1
......@@ -63,11 +63,11 @@ libgraph_tool_core.OStream.write = OStream_write
def pickler(stream, obj):
sstream = BytesIO()
pickle.dump(obj, sstream, -1)
stream.write(base64.b64encode(sstream.getvalue()))
stream.write(base64.b64encode(sstream.getvalue().encode('ascii')))
def unpickler(stream):
sstream = BytesIO(base64.b64decode(stream.read()))
sstream = BytesIO(base64.b64decode(stream.read().encode('ascii')))
return pickle.load(sstream)
libgraph_tool_core.set_pickler(pickler)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment