diff --git a/builder.py b/builder.py index 9878e86..0dacc1a 100644 --- a/builder.py +++ b/builder.py @@ -211,7 +211,13 @@ class BuildJob: os.rename(self.tmpname2, t) os.unlink(self.tmpname1) elif st1.st_size > 0: - os.rename(self.tmpname1, t) + try: + os.rename(self.tmpname1, t) + except OSError, e: + if e.errno == errno.ENOENT: + unlink(t) + else: + raise if st2: os.unlink(self.tmpname2) else: # no output generated at all; that's ok diff --git a/clean.do b/clean.do index 311be33..dfebaed 100644 --- a/clean.do +++ b/clean.do @@ -6,3 +6,4 @@ fi redo t/clean rm -f *~ .*~ */*~ */.*~ *.pyc rm -rf t/.redo +find -name '*.tmp' -exec rm -fv {} \;