Skip to content
Snippets Groups Projects
Commit 9a2f4b2e authored by Thomas Arendsen Hein's avatar Thomas Arendsen Hein
Browse files

gpg extension: Always remove temporary files created by 'hg sigcheck'.

parent 33295034
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
def verify(self, data, sig):
""" returns of the good and bad signatures"""
sigfile = datafile = None
try:
# create temporary files
fd, sigfile = tempfile.mkstemp(prefix="hg-gpg-", suffix=".sig")
......@@ -34,8 +35,8 @@
gpgcmd = ("%s --logger-fd 1 --status-fd 1 --verify "
"\"%s\" \"%s\"" % (self.path, sigfile, datafile))
ret = util.filter("", gpgcmd)
except:
finally:
for f in (sigfile, datafile):
try:
if f: os.unlink(f)
except: pass
......@@ -38,8 +39,7 @@
for f in (sigfile, datafile):
try:
if f: os.unlink(f)
except: pass
raise
keys = []
key, fingerprint = None, None
err = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment