Skip to content

Commit

Permalink
feat: Handle keyboard interruptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Oct 4, 2020
1 parent 144b33d commit 1c5b594
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/duty/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ def run(self, cmd: Union[str, List[str], Callable], args=None, kwargs=None, **op
"""
final_options = dict(self.options)
final_options.update(options)
code = failprint_run(cmd, args=args, kwargs=kwargs, **final_options)
try:
code = failprint_run(cmd, args=args, kwargs=kwargs, **final_options)
except KeyboardInterrupt:
code = 130
if code:
raise DutyFailure(code)

Expand Down

0 comments on commit 1c5b594

Please sign in to comment.