summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2022-03-15 19:15:21 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2022-03-15 19:15:21 +0100
commit1a672b0e129363877de649a8e13291c8de7cde42 (patch)
tree3591eb1841c4f5df030764cf009708ed3e55496e
parent5077b0030506b5804d12d795432547b43e44604d (diff)
If the edited file is not found, there is no FileNotFoundError
-rw-r--r--hazwaz/mixins.py14
1 files 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