1 parent 0672712 commit 0f1afb1Copy full SHA for 0f1afb1
1 file changed
Lib/test/test_import.py
@@ -88,7 +88,7 @@ def test_module_with_large_stack(module):
88
f.write(']')
89
f.close()
90
91
- # compile & remove .py file, we only need .pyc
+ # compile & remove .py file, we only need .pyc (or .pyo)
92
f = open(filename, 'r')
93
py_compile.compile(filename)
94
@@ -102,6 +102,9 @@ def test_module_with_large_stack(module):
102
103
# cleanup
104
del sys.path[-1]
105
- os.unlink(module + '.pyc')
+ for ext in '.pyc', '.pyo':
106
+ fname = module + ext
107
+ if os.path.exists(fname):
108
+ os.unlink(fname)
109
110
test_module_with_large_stack('longlist')
0 commit comments