mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
subprocess._optim_args_from_interpreter_flags()
Issue #26100: * Add subprocess._optim_args_from_interpreter_flags() * Add test.support.optim_args_from_interpreter_flags() * Use new functions in distutils, test_cmd_line_script, test_compileall and test_inspect The change enables test_details() test of test_inspect when -O or -OO command line option is used.
This commit is contained in:
parent
c437d0cb4e
commit
9def284387
6 changed files with 35 additions and 18 deletions
|
|
@ -231,10 +231,9 @@ class CommandLineTests(unittest.TestCase):
|
|||
raise unittest.SkipTest('not all entries on sys.path are writable')
|
||||
|
||||
def _get_run_args(self, args):
|
||||
interp_args = ['-S']
|
||||
if sys.flags.optimize:
|
||||
interp_args.append({1 : '-O', 2 : '-OO'}[sys.flags.optimize])
|
||||
return interp_args + ['-m', 'compileall'] + list(args)
|
||||
return [*support.optim_args_from_interpreter_flags(),
|
||||
'-S', '-m', 'compileall',
|
||||
*args]
|
||||
|
||||
def assertRunOK(self, *args, **env_vars):
|
||||
rc, out, err = script_helper.assert_python_ok(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue