From 5efe9d0865235d61f4c8c8d339a398a9adb50aca Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 29 Oct 2010 11:08:32 +0000 Subject: [PATCH] Fix ResourceWarning in Lib/test/threaded_import_hangers.py --- Lib/test/threaded_import_hangers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/threaded_import_hangers.py b/Lib/test/threaded_import_hangers.py index d7508741d3..adf03e31ff 100644 --- a/Lib/test/threaded_import_hangers.py +++ b/Lib/test/threaded_import_hangers.py @@ -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, ('.',)), -- 2.40.0