From 38c2f194745abe9635813c980259eeb6f570f3b1 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 5 Dec 2022 16:40:44 +0000 Subject: [PATCH] eddn: Suppress "converted file" for legacy if no file This was a total brainfart, `finally:` is never what was wanted here. So, just `return` if `FileNotFoundError`. --- plugins/eddn.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index deb3fcc9..8de9e093 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -251,15 +251,14 @@ class EDDNSender: self.add_message(cmdr, msg) except FileNotFoundError: - pass + return - finally: - # Best effort at removing the file/contents - # NB: The legacy code assumed it could write to the file. - logger.info("Conversion` to `eddn_queue-v1.db` complete, removing `replay.jsonl`") - replay_file = open(filename, 'w') # Will truncate - replay_file.close() - os.unlink(filename) + # Best effort at removing the file/contents + # NB: The legacy code assumed it could write to the file. + logger.info("Conversion` to `eddn_queue-v1.db` complete, removing `replay.jsonl`") + replay_file = open(filename, 'w') # Will truncate + replay_file.close() + os.unlink(filename) def close(self) -> None: """Clean up any resources."""