summaryrefslogtreecommitdiff
path: root/Lib/test/test_compileall.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-01-18 12:15:08 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-01-18 12:15:08 +0100
commit9def2843873edde3feec6eaf2ee60c4e48172164 (patch)
tree9a7e862b8677c29fd877d55ea38b37d680087cfd /Lib/test/test_compileall.py
parentc437d0cb4e99bd58ff0150414b5d5f0b26605687 (diff)
downloadcpython-git-9def2843873edde3feec6eaf2ee60c4e48172164.tar.gz
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.
Diffstat (limited to 'Lib/test/test_compileall.py')
-rw-r--r--Lib/test/test_compileall.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
index 6d8a86352f..9b424a7250 100644
--- a/Lib/test/test_compileall.py
+++ b/Lib/test/test_compileall.py
@@ -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(