mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Inherit interpreter flags in parallel testing
This commit is contained in:
parent
9a6692f6d7
commit
1b03f2ca83
2 changed files with 22 additions and 5 deletions
|
@ -1327,3 +1327,22 @@ def strip_python_stderr(stderr):
|
|||
"""
|
||||
stderr = re.sub(br"\[\d+ refs\]\r?\n?$", b"", stderr).strip()
|
||||
return stderr
|
||||
|
||||
def args_from_interpreter_flags():
|
||||
"""Return a list of command-line arguments reproducing the current
|
||||
settings in sys.flags."""
|
||||
flag_opt_map = {
|
||||
'bytes_warning': 'b',
|
||||
'dont_write_bytecode': 'B',
|
||||
'ignore_environment': 'E',
|
||||
'no_user_site': 's',
|
||||
'no_site': 'S',
|
||||
'optimize': 'O',
|
||||
'verbose': 'v',
|
||||
}
|
||||
args = []
|
||||
for flag, opt in flag_opt_map.items():
|
||||
v = getattr(sys.flags, flag)
|
||||
if v > 0:
|
||||
args.append('-' + opt * v)
|
||||
return args
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue