test_threaded_import must clean up after itself

This commit is contained in:
Antoine Pitrou 2011-07-15 23:09:13 +02:00
parent f26ad7149f
commit 075050f84f
2 changed files with 16 additions and 9 deletions

View file

@ -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