Commits

Simon H.  committed 21230bc

hgemail: fix 2nd error message when tmpfile can not be created

  • Participants
  • Parent commits a0530bb

Comments (0)

Files changed (1)

File hggtk/hgemail.py

         desc = self.descbuffer.get_text(start, end)
         if desc and self._intro:
             cmdline += ['--intro']
+        tmpfile = None
         try:
             fd, tmpfile = tempfile.mkstemp(prefix="thg_emaildesc_")
             os.write(fd, desc)
         finally:
             if oldpager:
                 os.environ['PAGER'] = oldpager
-            os.unlink(tmpfile)
+            if tmpfile:
+                os.unlink(tmpfile)
+