Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
25408915
Commit
25408915
authored
Dec 18, 2012
by
Tiago Peixoto
Browse files
Get rid of cPickle module since it has been removed in python3
parent
d839faf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/io.py
View file @
25408915
...
...
@@ -20,7 +20,7 @@
from
__future__
import
division
,
absolute_import
,
print_function
import
cP
ickle
import
p
ickle
import
base64
import
atexit
from
io
import
BytesIO
...
...
@@ -62,13 +62,13 @@ libgraph_tool_core.OStream.write = OStream_write
# define and set the pickler/unpickler functions
def
pickler
(
stream
,
obj
):
sstream
=
BytesIO
()
cP
ickle
.
dump
(
obj
,
sstream
,
-
1
)
p
ickle
.
dump
(
obj
,
sstream
,
-
1
)
stream
.
write
(
base64
.
b64encode
(
sstream
.
getvalue
()))
def
unpickler
(
stream
):
sstream
=
BytesIO
(
base64
.
b64decode
(
stream
.
read
()))
return
cP
ickle
.
load
(
sstream
)
return
p
ickle
.
load
(
sstream
)
libgraph_tool_core
.
set_pickler
(
pickler
)
libgraph_tool_core
.
set_unpickler
(
unpickler
)
...
...
Tiago Peixoto
@count0
mentioned in issue
#7 (closed)
·
Aug 06, 2014
mentioned in issue
#7 (closed)
mentioned in issue #7
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment