mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)
PyConfig_Read() is now responsible to handle early calls to PySys_AddXOption() and PySys_AddWarnOption(). Options added by PySys_AddXOption() are now handled the same way than PyConfig.xoptions and command line -X options. For example, PySys_AddXOption(L"faulthandler") enables faulthandler as expected.
This commit is contained in:
parent
1beb7c3de9
commit
120b707a6d
6 changed files with 115 additions and 30 deletions
|
@ -902,6 +902,23 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
api=API_PYTHON,
|
||||
modify_path_cb=modify_path)
|
||||
|
||||
def test_init_sys_add(self):
|
||||
config = {
|
||||
'faulthandler': 1,
|
||||
'xoptions': [
|
||||
'config_xoption',
|
||||
'cmdline_xoption',
|
||||
'sysadd_xoption',
|
||||
'faulthandler',
|
||||
],
|
||||
'warnoptions': [
|
||||
'ignore:::config_warnoption',
|
||||
'ignore:::cmdline_warnoption',
|
||||
'ignore:::sysadd_warnoption',
|
||||
],
|
||||
}
|
||||
self.check_all_configs("test_init_sys_add", config, api=API_PYTHON)
|
||||
|
||||
def test_init_run_main(self):
|
||||
code = ('import _testinternalcapi, json; '
|
||||
'print(json.dumps(_testinternalcapi.get_configs()))')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue