[Python-checkins] bpo-35451: Fix reference counting for sys.warnoptions and sys._xoptions. (GH-11063)

Serhiy Storchaka webhook-mailer at python.org
Mon Dec 10 05:08:58 EST 2018


https://github.com/python/cpython/commit/72ff7b4c000f7b8199231a0eb1ca4b119fab40a5
commit: 72ff7b4c000f7b8199231a0eb1ca4b119fab40a5
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-12-10T12:08:54+02:00
summary:

bpo-35451: Fix reference counting for sys.warnoptions and sys._xoptions. (GH-11063)

files:
M Python/sysmodule.c

diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 49fa3842b583..e6f1c4e8e9e0 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1774,7 +1774,6 @@ get_warnoptions(void)
          * call optional for embedding applications, thus making this
          * reachable again.
          */
-        Py_XDECREF(warnoptions);
         warnoptions = PyList_New(0);
         if (warnoptions == NULL)
             return NULL;
@@ -1864,7 +1863,6 @@ get_xoptions(void)
          * call optional for embedding applications, thus making this
          * reachable again.
          */
-        Py_XDECREF(xoptions);
         xoptions = PyDict_New();
         if (xoptions == NULL)
             return NULL;



More information about the Python-checkins mailing list