Try/Except on os.remove

This commit is contained in:
Sergio Durigan Junior 2018-11-20 14:17:20 -05:00
parent 212ae68256
commit ccf7a5411e

View file

@ -489,10 +489,18 @@ send to the gdb-testers mailing list."""
rev_broke = f.readline ().lstrip ("Commit: ")
mid_file = make_breakage_root_message_id_filename (rev_broke, branch)
# We need to clean the lockfile. Garbage-collect it here.
os.remove (lockfile)
try:
os.remove (lockfile)
except OSError as e:
print "Failed with: ", e.strerror
print "Error code: ", e.code
if mid_file and os.path.exists (mid_file):
# Garbage-collect the Message-Id file
os.remove (mid_file)
try:
os.remove (mid_file)
except OSError as e:
print "Failed with: ", e.streror
print "Error code: ", e.code
return { 'body' : text,
'type' : 'plain',