[yum-cvs] yum/yum plugins.py,1.34,1.35

James Bowes jbowes at linux.duke.edu
Sat Nov 25 22:40:56 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv5175/yum

Modified Files:
	plugins.py 
Log Message:
Close the file descriptor used by imp in case an exception is thrown.

Index: plugins.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/plugins.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- plugins.py	2 Oct 2006 16:34:32 -0000	1.34
+++ plugins.py	25 Nov 2006 22:40:53 -0000	1.35
@@ -183,7 +183,10 @@
             return
 
         fp, pathname, description = imp.find_module(modname, [dir])
-        module = imp.load_module(modname, fp, pathname, description)
+        try:
+            module = imp.load_module(modname, fp, pathname, description)
+        finally:
+            fp.close()
 
         # Check API version required by the plugin
         if not hasattr(module, 'requires_api_version'):




More information about the Yum-cvs-commits mailing list