From 2f4651d22ba75d266d46680e344cbf0dd966f005 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 5 Apr 2019 21:22:05 +0200 Subject: [PATCH] jp (avatar/get): fixed avatar being displayed 2 times in a corner case: when avatar is shown by ImageMagick's display and it is terminated using SIGINT, the return code is 2 and not 0. Before this patch, jp was interpreting the 2 as an image not displayed and so was trying with the next available command Now it is stopping when exit code 2 is received. --- sat_frontends/jp/cmd_avatar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sat_frontends/jp/cmd_avatar.py b/sat_frontends/jp/cmd_avatar.py index 007d3d7c..baf32c0a 100644 --- a/sat_frontends/jp/cmd_avatar.py +++ b/sat_frontends/jp/cmd_avatar.py @@ -88,7 +88,8 @@ class Get(base.CommandBase): except OSError: pass else: - if ret == 0: + if ret in (0, 2): + # we can get exit code 2 with display when stopping it with C-c break else: # didn't worked with commands, we try our luck with webbrowser