diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 19:01:21 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 19:01:21 (GMT) |
commit | 8391cf4e1d73683795e51ac5ce8ee9e61eea389d (patch) | |
tree | 74cb0a14d80ef882572635d12e41cba1725fe6d8 | |
parent | 9470ab43a9804928275b0a2a0860a2028af854db (diff) | |
download | cpython-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/NEWS | 3 | ||||
-rw-r--r-- | Modules/_pickle.c | 2 |
2 files changed, 5 insertions, 0 deletions
@@ -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; |