]> granicus.if.org Git - python/commitdiff
Issue #15926: Fix crash after multiple reinitializations of the interpreter.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 12 Sep 2012 16:01:36 +0000 (18:01 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 12 Sep 2012 16:01:36 +0000 (18:01 +0200)
Misc/NEWS
Modules/posixmodule.c

index 05941528150773c77cc9856c67831c66a1f1f671..882d274789af36d8bdb888d56e053138872854ce 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ What's New in Python 3.3.0 Release Candidate 3?
 Core and Builtins
 -----------------
 
+- Issue #15926: Fix crash after multiple reinitializations of the interpreter.
+
 - Issue #15895: Fix FILE pointer leak in one error branch of
   PyRun_SimpleFileExFlags() when filename points to a pyc/pyo file, closeit
   is false an and set_main_loader() fails.
index 1f2b0cc0cad6fa655083bd6a37513397cf54d5d2..54f6cd2b22cf9f619ff0836d07b59ddf787b80ab 100644 (file)
@@ -11852,7 +11852,6 @@ INITFUNC(void)
 
         /* initialize TerminalSize_info */
         PyStructSequence_InitType(&TerminalSizeType, &TerminalSize_desc);
-        Py_INCREF(&TerminalSizeType);
     }
 #if defined(HAVE_WAITID) && !defined(__APPLE__)
     Py_INCREF((PyObject*) &WaitidResultType);
@@ -11915,6 +11914,7 @@ INITFUNC(void)
 
 #endif /* __APPLE__ */
 
+    Py_INCREF(&TerminalSizeType);
     PyModule_AddObject(m, "terminal_size", (PyObject*) &TerminalSizeType);
 
     billion = PyLong_FromLong(1000000000);