fix removed file on print hook

This commit is contained in:
Simon Zeyer 2024-10-16 18:23:22 +00:00
parent a4006721d3
commit d816c9d302

View File

@ -143,8 +143,8 @@ def cups_print(parsed_body: dict, body: str):
if 'ALARMDEPESCHE' in parsed_body:
for i in range(0, print_num):
conn.printFile (printer, fname, "Alarmfax", {})
os.remove(fname)
except Exception as e:
logging.error("cups_print", e)
finally:
if os.path.exists(fname):
os.remove(fname)
logging.error("cups_print", e)
os.remove(fname)