]> granicus.if.org Git - python/commitdiff
Fix ResourceWarning in Lib/test/threaded_import_hangers.py
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 29 Oct 2010 11:08:32 +0000 (11:08 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 29 Oct 2010 11:08:32 +0000 (11:08 +0000)
Lib/test/threaded_import_hangers.py

index d7508741d3fe11788b2b2dbfe3cbb5a0c92a5753..adf03e31ffd663ac2df95a2b4fabc053b04b9bbe 100644 (file)
@@ -29,7 +29,7 @@ class Worker(threading.Thread):
 
 for name, func, args in [
         # Bug 147376:  TemporaryFile hung on Windows, starting in Python 2.4.
-        ("tempfile.TemporaryFile", tempfile.TemporaryFile, ()),
+        ("tempfile.TemporaryFile", lambda: tempfile.TemporaryFile().close(), ()),
 
         # The real cause for bug 147376:  ntpath.abspath() caused the hang.
         ("os.path.abspath", os.path.abspath, ('.',)),