summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/sysmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 7410601..424a88f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2136,10 +2136,10 @@ _PySys_EndInit(PyObject *sysdict)
if (warnoptions == NULL)
return -1;
}
- else {
- Py_INCREF(warnoptions);
- }
- SET_SYS_FROM_STRING_BORROW_INT_RESULT("warnoptions", warnoptions);
+
+ SET_SYS_FROM_STRING_INT_RESULT("warnoptions",
+ PyList_GetSlice(warnoptions,
+ 0, Py_SIZE(warnoptions)));
SET_SYS_FROM_STRING_BORROW_INT_RESULT("_xoptions", get_xoptions());