summaryrefslogtreecommitdiffstats
path: root/Lib/test/threaded_import_hangers.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-15 21:09:13 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-15 21:09:13 (GMT)
commit075050f84f15fb0681254dc3a0b7a53e9fe6668f (patch)
tree93294ba43d5efa613d422e83afd7da764740ddc2 /Lib/test/threaded_import_hangers.py
parentf26ad7149f91db1baf2dff38c9ad7a4f6f035036 (diff)
downloadcpython-075050f84f15fb0681254dc3a0b7a53e9fe6668f.zip
cpython-075050f84f15fb0681254dc3a0b7a53e9fe6668f.tar.gz
cpython-075050f84f15fb0681254dc3a0b7a53e9fe6668f.tar.bz2
test_threaded_import must clean up after itself
Diffstat (limited to 'Lib/test/threaded_import_hangers.py')
-rw-r--r--Lib/test/threaded_import_hangers.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/test/threaded_import_hangers.py b/Lib/test/threaded_import_hangers.py
index adf03e3..d7cc255 100644
--- a/Lib/test/threaded_import_hangers.py
+++ b/Lib/test/threaded_import_hangers.py
@@ -35,8 +35,12 @@ for name, func, args in [
("os.path.abspath", os.path.abspath, ('.',)),
]:
- t = Worker(func, args)
- t.start()
- t.join(TIMEOUT)
- if t.is_alive():
- errors.append("%s appeared to hang" % name)
+ try:
+ t = Worker(func, args)
+ t.start()
+ t.join(TIMEOUT)
+ if t.is_alive():
+ errors.append("%s appeared to hang" % name)
+ finally:
+ del t
+