[pypy-svn] r68224 - pypy/trunk/pypy/translator/c/gcc

arigo at codespeak.net arigo at codespeak.net
Wed Oct 7 11:08:25 CEST 2009


Author: arigo
Date: Wed Oct  7 11:08:24 2009
New Revision: 68224

Modified:
   pypy/trunk/pypy/translator/c/gcc/trackgcroot.py
Log:
Remove the incomplete .lbl.s file in case of an exception.


Modified: pypy/trunk/pypy/translator/c/gcc/trackgcroot.py
==============================================================================
--- pypy/trunk/pypy/translator/c/gcc/trackgcroot.py	(original)
+++ pypy/trunk/pypy/translator/c/gcc/trackgcroot.py	Wed Oct  7 11:08:24 2009
@@ -1211,9 +1211,14 @@
             assert fn.endswith('.s')
             lblfn = fn[:-2] + '.lbl.s'
             g = open(lblfn, 'w')
-            tracker.process(f, g, filename=fn)
-            f.close()
+            try:
+                tracker.process(f, g, filename=fn)
+            except:
+                g.close()
+                os.unlink(lblfn)
+                raise
             g.close()
+            f.close()
             if output_raw_table:
                 tracker.dump_raw_table(sys.stdout)
                 tracker.clear()



More information about the Pypy-commit mailing list