diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 23:09:13 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-15 23:09:13 +0200 |
commit | 35b01b9e7d6fd65169b2d4ca75e3c3d2671857b8 (patch) | |
tree | d4f50d12534f7a9e4f148700c4810c5cba27b357 /Lib/test/threaded_import_hangers.py | |
parent | 7d103ac569fea2687f87b83d0f78fee9906cd492 (diff) | |
download | cpython-35b01b9e7d6fd65169b2d4ca75e3c3d2671857b8.tar.gz |
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.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/test/threaded_import_hangers.py b/Lib/test/threaded_import_hangers.py index adf03e31ff..d7cc255998 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 + |