summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-11-08 12:16:28 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-11-08 12:16:28 +0000
commita6c9c52a578e953bc4af64e300ca24cbde8eea4e (patch)
tree586cce42d79339c1a49c666be5aa8603b524dcf3
parenta283f02ce9f5d72f03c783d516d69d8f57069ef4 (diff)
parent5e0d8d5abe7b525ad28875db0146231be5e39453 (diff)
downloadbuildstream-a6c9c52a578e953bc4af64e300ca24cbde8eea4e.tar.gz
Merge branch 'bschubert/fix-children-termination' into 'master'
app.py: Also catch SystemError with click.Abort See merge request BuildStream/buildstream!1690
-rw-r--r--src/buildstream/_frontend/app.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/buildstream/_frontend/app.py b/src/buildstream/_frontend/app.py
index 45160afbc..596ef168a 100644
--- a/src/buildstream/_frontend/app.py
+++ b/src/buildstream/_frontend/app.py
@@ -532,7 +532,10 @@ class App():
choice = click.prompt("Choice:",
value_proc=_prefix_choice_value_proc(['continue', 'quit', 'terminate']),
default='continue', err=True)
- except click.Abort:
+ except (click.Abort, SystemError):
+ # In some cases, the readline buffer underlying the prompt gets corrupted on the second CTRL+C
+ # This throws a SystemError, which doesn't seem to be problematic for the rest of the program
+
# Ensure a newline after automatically printed '^C'
click.echo("", err=True)
choice = 'terminate'
@@ -630,7 +633,10 @@ class App():
try:
choice = click.prompt("Choice:", default='continue', err=True,
value_proc=_prefix_choice_value_proc(choices))
- except click.Abort:
+ except (click.Abort, SystemError):
+ # In some cases, the readline buffer underlying the prompt gets corrupted on the second CTRL+C
+ # This throws a SystemError, which doesn't seem to be problematic for the rest of the program
+
# Ensure a newline after automatically printed '^C'
click.echo("", err=True)
choice = 'terminate'