Commit 01d9c519 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Cleanup pickler/unpickler objects in io.py

This is to avoid strange segfaults in atexit functions defined by
boost::python.
parent 440abbdb
......@@ -22,6 +22,7 @@ from __future__ import division, absolute_import, print_function
import cPickle
import base64
import atexit
from io import BytesIO
from . import libgraph_tool_core
......@@ -71,3 +72,9 @@ def unpickler(stream):
libgraph_tool_core.set_pickler(pickler)
libgraph_tool_core.set_unpickler(unpickler)
def clean_picklers():
libgraph_tool_core.set_pickler(None)
libgraph_tool_core.set_unpickler(None)
atexit.register(clean_picklers)
Supports Markdown
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