Commits

Jed Brown  committed 275495e

cmakegen.py: ensure that file is closed before attempting cleanup

Preserves closer to 'with' statement semantics with python-2.4.

  • Participants
  • Parent commits 994b4da

Comments (0)

Files changed (1)

File config/cmakegen.py

   endforeach ()
 endif()''' % ('\n  '.join([r'PETSC' + pkg.upper() + r'_SRCS' for (pkg,_) in pkglist])))
     written = True
-    f.close()
   finally:
+    f.close()
     if written:
       shutil.move(tmplists,os.path.join(petscdir,'CMakeLists.txt'))
     else: