]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #11321: Fix a crash with multiple imports of the _pickle module when
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 15 Jul 2011 19:01:21 +0000 (21:01 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 15 Jul 2011 19:01:21 +0000 (21:01 +0200)
embedding Python.  Patch by Andreas Stührk.

Misc/NEWS
Modules/_pickle.c

index 18ee9d30b2f0bcb8e4af2475f92d65c1c551e12d..2154393776051a4df9dcc592d1867329beba3c8a 100644 (file)
--- 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
index e13d8742ca186542ab895ce695a6e3d65fb3bd78..287f0a3c15affa7eec03db24087406dc0c06b72e 100644 (file)
@@ -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;