diff options
author | Georg Brandl <georg@python.org> | 2010-10-14 08:08:56 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-14 08:08:56 (GMT) |
commit | f5247e35c186e4325c95e28554412f040aa5114f (patch) | |
tree | c0c658f1543a70c4cd81c14888e33d9e2cd17a75 /Lib/test/test_cmd_line_script.py | |
parent | 1463a3f8334b3279587af84d1134c559105f366a (diff) | |
download | cpython-f5247e35c186e4325c95e28554412f040aa5114f.zip cpython-f5247e35c186e4325c95e28554412f040aa5114f.tar.gz cpython-f5247e35c186e4325c95e28554412f040aa5114f.tar.bz2 |
#9964: fix running test_cmd_line_script under -O and -OO.
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r-- | Lib/test/test_cmd_line_script.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 75e9f8d..bd34392 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -1,6 +1,7 @@ # tests command line execution of scripts import unittest +import sys import os import os.path import py_compile @@ -97,6 +98,8 @@ class CmdLineTest(unittest.TestCase): expected_argv0, expected_path0, expected_package, *cmd_line_switches): + if not __debug__: + cmd_line_switches += ('-' + 'O' * sys.flags.optimize,) run_args = cmd_line_switches + (script_name,) rc, out, err = assert_python_ok(*run_args) self._check_output(script_name, rc, out + err, expected_file, |