summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-06-15 05:14:05 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-06-15 05:14:05 (GMT)
commit0f1afb1df3c1150cc2906ed85b2f52f89f51f670 (patch)
treeb95a48b4a41af02ce3643bdcf631bee6e9af5039 /Lib
parent06727123db954c6dd79b5db9348b36927f604a27 (diff)
downloadcpython-0f1afb1df3c1150cc2906ed85b2f52f89f51f670.zip
cpython-0f1afb1df3c1150cc2906ed85b2f52f89f51f670.tar.gz
cpython-0f1afb1df3c1150cc2906ed85b2f52f89f51f670.tar.bz2
test_module_with_large_stack(): This failed when Python was run with -O,
trying to delete a .pyc file that didn't exist (it needed to delete .pyo then).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_import.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 9342812..1ddd13e 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -88,7 +88,7 @@ def test_module_with_large_stack(module):
f.write(']')
f.close()
- # compile & remove .py file, we only need .pyc
+ # compile & remove .py file, we only need .pyc (or .pyo)
f = open(filename, 'r')
py_compile.compile(filename)
f.close()
@@ -102,6 +102,9 @@ def test_module_with_large_stack(module):
# cleanup
del sys.path[-1]
- os.unlink(module + '.pyc')
+ for ext in '.pyc', '.pyo':
+ fname = module + ext
+ if os.path.exists(fname):
+ os.unlink(fname)
test_module_with_large_stack('longlist')