rm prefile after closed

This commit is contained in:
Wes Barnett 2021-02-27 20:50:53 -05:00
parent 630354ac30
commit de9ef06efa
No known key found for this signature in database
GPG key ID: 1070BCC98C18BD66

View file

@ -93,9 +93,10 @@ def get_pre_number(snapshot_type, prefile):
try: try:
with open(prefile, "r") as f: with open(prefile, "r") as f:
pre_number = f.read().rstrip("\n") pre_number = f.read().rstrip("\n")
os.remove(prefile)
except FileNotFoundError: except FileNotFoundError:
raise FileNotFoundError(f"prefile {prefile} not found. Ensure you have run the pre snapshot first.") raise FileNotFoundError(f"prefile {prefile} not found. Ensure you have run the pre snapshot first.")
else:
os.remove(prefile)
return pre_number return pre_number