From 1a672b0e129363877de649a8e13291c8de7cde42 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Tue, 15 Mar 2022 19:15:21 +0100 Subject: If the edited file is not found, there is no FileNotFoundError --- hazwaz/mixins.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hazwaz/mixins.py b/hazwaz/mixins.py index 5720a38..25cc347 100644 --- a/hazwaz/mixins.py +++ b/hazwaz/mixins.py @@ -24,16 +24,10 @@ class ExternalEditorMixin: if editor: try: res = subprocess.call([editor, filepath]) - except FileNotFoundError as e: - if editor in str(e): - logging.info('Could not open file {} with {}'.format( - filepath, e_name - )) - else: - logging.warning("Could not open file {}".format( - filepath - )) - return False + except FileNotFoundError: + logging.info('Could not open file {} with {}'.format( + filepath, e_name + )) else: if res == 0: return True -- cgit v1.2.3