Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-30598: _PySys_EndInit() now duplicates warnoptions #1998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-30598: _PySys_EndInit() now duplicates warnoptions
Fix a reference in subinterpreters, like test_callbacks_leak() of
test_atexit.

warnoptions is a list used to pass options from the command line to
the sys module constructor. Before this change, the list was shared
by multiple interpreter which is not the expected behaviour. Each
interpreter should have their own independent mutable world.

This change duplicates the list in each interpreter. So each
interpreter owns its own list, so each interpreter can clear its own
list.
  • Loading branch information
vstinner committed Jun 8, 2017
commit 0e2d42849806ca77f6ed67e417482bd037dabe0f
8 changes: 4 additions & 4 deletions 8 Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.