Guarding the exclusion of mid_file on MessageGDBTesters

This commit is contained in:
Sergio Durigan Junior 2017-10-01 21:06:43 -04:00
parent f327722e06
commit a89211046c

View file

@ -480,13 +480,15 @@ send to the gdb-testers mailing list."""
# There is no build breakage anymore! Yay! Now, let's see if
# we need to clean up any lock file from previous breaks.
lockfile = make_breakage_lockfile_name (branch, name)
with open (lockfile, 'r') as f:
rev_broke = f.readline ().lstrip ("Commit: ")
mid_file = make_breakage_root_message_id_filename (rev_broke, branch)
rev_broke = None
mid_file = None
if os.path.exists (lockfile):
with open (lockfile, 'r') as f:
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)
if os.path.exists (mid_file):
if mid_file and os.path.exists (mid_file):
# Garbage-collect the Message-Id file
os.remove (mid_file)