mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
bpo-36763: Add _PyCoreConfig.parse_argv (GH-13361)
* _PyCoreConfig_Read() doesn't parse nor update argv if parse_argv is 0. * Move path configuration fields in _PyCoreConfig. * Add an unit test for parse_argv=0. * Remove unused "done": label in _Py_RunMain().
This commit is contained in:
parent
68b34a7204
commit
ae239f6b06
5 changed files with 109 additions and 36 deletions
|
@ -304,6 +304,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
|
||||
'pycache_prefix': None,
|
||||
'program_name': GET_DEFAULT_CONFIG,
|
||||
'parse_argv': 1,
|
||||
'argv': [""],
|
||||
'program': '',
|
||||
|
||||
|
@ -700,6 +701,14 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
}
|
||||
self.check_config("run_main_config", core_config, preconfig)
|
||||
|
||||
def test_init_dont_parse_argv(self):
|
||||
core_config = {
|
||||
'argv': ['-v', '-c', 'arg1', '-W', 'arg2'],
|
||||
'parse_argv': 0,
|
||||
'program': 'program',
|
||||
}
|
||||
self.check_config("init_dont_parse_argv", core_config, {})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue