mirror of https://github.com/python/cpython
A test was not guaranteeing cleanup in the face of an exception.
This commit is contained in:
parent
c5605ba144
commit
93220d0df1
|
@ -163,13 +163,14 @@ class ImportTests(unittest.TestCase):
|
||||||
# Need to be able to load from current dir.
|
# Need to be able to load from current dir.
|
||||||
sys.path.append('')
|
sys.path.append('')
|
||||||
|
|
||||||
# This used to crash.
|
try:
|
||||||
exec('import ' + module)
|
# This used to crash.
|
||||||
|
exec('import ' + module)
|
||||||
# Cleanup.
|
finally:
|
||||||
del sys.path[-1]
|
# Cleanup.
|
||||||
unlink(filename + 'c')
|
del sys.path[-1]
|
||||||
unlink(filename + 'o')
|
unlink(filename + 'c')
|
||||||
|
unlink(filename + 'o')
|
||||||
|
|
||||||
def test_failing_import_sticks(self):
|
def test_failing_import_sticks(self):
|
||||||
source = TESTFN + ".py"
|
source = TESTFN + ".py"
|
||||||
|
|
Loading…
Reference in New Issue