]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35451: Fix reference counting for sys.warnoptions and sys._xoptions. (GH-11063)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 10 Dec 2018 10:26:36 +0000 (02:26 -0800)
committerGitHub <noreply@github.com>
Mon, 10 Dec 2018 10:26:36 +0000 (02:26 -0800)
(cherry picked from commit 72ff7b4c000f7b8199231a0eb1ca4b119fab40a5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Python/sysmodule.c

index f04403b76aa0a261b370f907678038790b74e7c7..a0485073817083f5bcda14e1f86200f176dacb0d 100644 (file)
@@ -1757,7 +1757,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;
@@ -1842,7 +1841,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;