Skip to content

Commit 003d79f

Browse files
Bastian-KrauseEmantor
authored andcommitted
remote/client: exit with 1 on KeyboardInterrupt
When concatenating commands with '&&' or using 'set -e', a keyboard interrupt should lead to no further commands being executed. To allow this, rather exit with 1 than 0 on keyboard interrupt. Fixes: ef40183 ("remote/client: catch common errors and show a help message") Signed-off-by: Bastian Krause <[email protected]>
1 parent 63826bb commit 003d79f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Bug fixes in 0.4.1
1212
- Fixed ``labgrid-client forward --remote``/``-R``, which used either the LOCAL
1313
part of ``--local``/``-L`` accidentally (if specified) or raised an
1414
UnboundLocalError.
15+
- Fix labgrid-client exit code on keyboard interrupt.
1516

1617
Known issues in 0.4.1
1718
~~~~~~~~~~~~~~~~~~~~~~~~~

labgrid/remote/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ def main():
18521852
print(f"{parser.prog}: error: {e}", file=sys.stderr)
18531853
exitcode = 1
18541854
except KeyboardInterrupt:
1855-
exitcode = 0
1855+
exitcode = 1
18561856
except Exception: # pylint: disable=broad-except
18571857
traceback.print_exc()
18581858
exitcode = 2

0 commit comments

Comments
 (0)