Author: Philip Jenvey <pjen...@underboss.org>
Branch: 
Changeset: r70956:308ded060ac8
Date: 2014-04-24 18:34 -0700
http://bitbucket.org/pypy/pypy/changeset/308ded060ac8/

Log:    close it when finished

diff --git a/lib_pypy/_testcapi.py b/lib_pypy/_testcapi.py
--- a/lib_pypy/_testcapi.py
+++ b/lib_pypy/_testcapi.py
@@ -1,4 +1,5 @@
-import imp, os
+import imp
+import os
 
 try:
     import cpyext
@@ -12,6 +13,9 @@
 
 try:
     fp, filename, description = imp.find_module('_testcapi', path=[output_dir])
-    imp.load_module('_testcapi', fp, filename, description)
+    try:
+        imp.load_module('_testcapi', fp, filename, description)
+    finally:
+        fp.close()
 except ImportError:
     _pypy_testcapi.compile_shared(cfile, '_testcapi', output_dir)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to