]> granicus.if.org Git - python/commit
bpo-30598: _PySys_EndInit() now duplicates warnoptions (#1998)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 8 Jun 2017 11:27:47 +0000 (13:27 +0200)
committerGitHub <noreply@github.com>
Thu, 8 Jun 2017 11:27:47 +0000 (13:27 +0200)
commit865de27dd79571a4a5c7a7d22a07fb909c4a9f8e
treec2daa68764203687d70f0d15f5df2a7fb3764ac7
parentab1cb80b435a34e4f908c97cd2f3a7fe8add6505
bpo-30598: _PySys_EndInit() now duplicates warnoptions (#1998)

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.
Python/sysmodule.c