summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 bfdc3a3..28f8d0a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -225,6 +225,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 #6755: Add get_wch() method to curses.window class. Patch by Iñigo
Serna.
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 822d03c..06bce1e 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -6338,8 +6338,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;