Skip to content

Commit fc277de

Browse files
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 dc8392a commit fc277de

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Bug fixes in 0.5.0
1010

1111
- Fixed a bug where using ``labgrid-client io get`` always returned ``low``
1212
when reading a ``sysfsgpio``.
13+
- Fix labgrid-client exit code on keyboard interrupt.
1314

1415
Breaking changes in 0.5.0
1516
~~~~~~~~~~~~~~~~~~~~~~~~~

labgrid/remote/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ def main():
19041904
print(f"{parser.prog}: error: {e}", file=sys.stderr)
19051905
exitcode = 1
19061906
except KeyboardInterrupt:
1907-
exitcode = 0
1907+
exitcode = 1
19081908
except Exception: # pylint: disable=broad-except
19091909
traceback.print_exc()
19101910
exitcode = 2

0 commit comments

Comments
 (0)