Commits

Ned Batchelder committed 7e87e27

Move the open outside the try, since the finally is only needed once the file is successfully opened.

Comments (0)

Files changed (1)

coverage/execfile.py

     sys.argv = args
     sys.path[0] = os.path.dirname(filename)
 
+    src = open(filename)
     try:
-        src = open(filename)
         imp.load_module('__main__', src, filename, (".py", "r", imp.PY_SOURCE))
     finally:
         src.close()