From: Ned Deily Date: Mon, 15 Aug 2016 18:40:38 +0000 (-0400) Subject: Issue #27736: Prevent segfault after interpreter re-initialization due X-Git-Tag: v3.6.0a4~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb3be66b3a825c56bb2bcd9ce4ad237585187c64;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Misc/NEWS b/Misc/NEWS index ec86a53d651a..affaffd7385b 100644 --- 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. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 52e465f1ffd0..10d6bcbba977 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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;