bpo-35451: Fix reference counting for sys.warnoptions and sys._xoptions. (GH-11063)
(cherry picked from commit 72ff7b4c00
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
c83ec055a0
commit
fc79175f5e
|
@ -1757,7 +1757,6 @@ get_warnoptions(void)
|
||||||
* call optional for embedding applications, thus making this
|
* call optional for embedding applications, thus making this
|
||||||
* reachable again.
|
* reachable again.
|
||||||
*/
|
*/
|
||||||
Py_XDECREF(warnoptions);
|
|
||||||
warnoptions = PyList_New(0);
|
warnoptions = PyList_New(0);
|
||||||
if (warnoptions == NULL)
|
if (warnoptions == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1842,7 +1841,6 @@ get_xoptions(void)
|
||||||
* call optional for embedding applications, thus making this
|
* call optional for embedding applications, thus making this
|
||||||
* reachable again.
|
* reachable again.
|
||||||
*/
|
*/
|
||||||
Py_XDECREF(xoptions);
|
|
||||||
xoptions = PyDict_New();
|
xoptions = PyDict_New();
|
||||||
if (xoptions == NULL)
|
if (xoptions == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue