]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #27736: Prevent segfault after interpreter re-initialization due
authorNed Deily <nad@python.org>
Mon, 15 Aug 2016 18:40:38 +0000 (14:40 -0400)
committerNed Deily <nad@python.org>
Mon, 15 Aug 2016 18:40:38 +0000 (14:40 -0400)
to ref count problem introduced in code for Issue #27038 in 3.6.0a3.
Patch by Xiang Zhang.

Misc/NEWS
Modules/posixmodule.c

index ec86a53d651a8d56f9f46e2ca8fdc1010f418130..affaffd7385b0ef00d1f9e88be80d53a50e96d5f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -57,6 +57,10 @@ Core and Builtins
 Library
 -------
 
+- Issue #27736: Prevent segfault after interpreter re-initialization due
+  to ref count problem introduced in code for Issue #27038 in 3.6.0a3.
+  Patch by Xiang Zhang.
+
 - Issue #12345: Add mathemathcal constant tau to math and cmath. See also
   PEP 628.
 
index 52e465f1ffd0800467a50f2eb3dbc94f68310768..10d6bcbba9779b642159b202ed1048dd06e2c398 100644 (file)
@@ -13355,6 +13355,8 @@ INITFUNC(void)
         Py_DECREF(unicode);
     }
     PyModule_AddObject(m, "_have_functions", list);
+
+    Py_INCREF((PyObject *) &DirEntryType);
     PyModule_AddObject(m, "DirEntry", (PyObject *)&DirEntryType);
 
     initialized = 1;