mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-109566: regrtest reexecutes the process (#109909)
When --fast-ci or --slow-ci option is used, regrtest now replaces the current process with a new process to add "-u -W default -bb -E" options to Python. Changes: * PCbuild/rt.bat and Tools/scripts/run_tests.py no longer need to add "-u -W default -bb -E" options to Python: it's now done by regrtest. * Fix Tools/scripts/run_tests.py: flush stdout before replacing the process. Previously, buffered messages were lost.
This commit is contained in:
parent
ecd813f054
commit
fbfec5642e
7 changed files with 107 additions and 14 deletions
|
@ -23,11 +23,7 @@ def is_python_flag(arg):
|
|||
|
||||
|
||||
def main(regrtest_args):
|
||||
args = [sys.executable,
|
||||
'-u', # Unbuffered stdout and stderr
|
||||
'-W', 'default', # Warnings set to 'default'
|
||||
'-bb', # Warnings about bytes/bytearray
|
||||
]
|
||||
args = [sys.executable]
|
||||
|
||||
cross_compile = '_PYTHON_HOST_PLATFORM' in os.environ
|
||||
if (hostrunner := os.environ.get("_PYTHON_HOSTRUNNER")) is None:
|
||||
|
@ -47,7 +43,6 @@ def main(regrtest_args):
|
|||
}
|
||||
else:
|
||||
environ = os.environ.copy()
|
||||
args.append("-E")
|
||||
|
||||
# Allow user-specified interpreter options to override our defaults.
|
||||
args.extend(test.support.args_from_interpreter_flags())
|
||||
|
@ -70,7 +65,8 @@ def main(regrtest_args):
|
|||
|
||||
args.extend(regrtest_args)
|
||||
|
||||
print(shlex.join(args))
|
||||
print(shlex.join(args), flush=True)
|
||||
|
||||
if sys.platform == 'win32':
|
||||
from subprocess import call
|
||||
sys.exit(call(args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue