summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-15 19:01:21 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-15 19:01:21 (GMT)
commit8391cf4e1d73683795e51ac5ce8ee9e61eea389d (patch)
tree74cb0a14d80ef882572635d12e41cba1725fe6d8
parent9470ab43a9804928275b0a2a0860a2028af854db (diff)
downloadcpython-8391cf4e1d73683795e51ac5ce8ee9e61eea389d.zip
cpython-8391cf4e1d73683795e51ac5ce8ee9e61eea389d.tar.gz
cpython-8391cf4e1d73683795e51ac5ce8ee9e61eea389d.tar.bz2
Issue #11321: Fix a crash with multiple imports of the _pickle module when
embedding Python. Patch by Andreas Stührk.
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/_pickle.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 18ee9d3..2154393 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,9 @@ Core and Builtins
Library
-------
+- Issue #11321: Fix a crash with multiple imports of the _pickle module when
+ embedding Python. Patch by Andreas Stührk.
+
- Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
- Issue #4376: ctypes now supports nested structures in a endian different than
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index e13d874..287f0a3 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -6321,8 +6321,10 @@ PyInit__pickle(void)
if (m == NULL)
return NULL;
+ Py_INCREF(&Pickler_Type);
if (PyModule_AddObject(m, "Pickler", (PyObject *)&Pickler_Type) < 0)
return NULL;
+ Py_INCREF(&Unpickler_Type);
if (PyModule_AddObject(m, "Unpickler", (PyObject *)&Unpickler_Type) < 0)
return NULL;