Skip to content

Commit

Permalink
convert SIGINT to CTRL_C_EVENT in signal handler when on windows
Browse files Browse the repository at this point in the history
send_signal() implementation on windows only supports SIGTERM,
CTRL_C_EVENT and CTRL_BREAK_EVENT

Ref: nat-n#42
  • Loading branch information
JCapul committed Dec 14, 2022
1 parent 5951507 commit d291a5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions poethepoet/executor/base.py
Expand Up @@ -209,6 +209,8 @@ def _exec_via_subproc(

# signal pass through
def handle_signal(signum, _frame):
# sigint is not handled by send_signal() windows implementation
signum = signal.CTRL_C_EVENT if self._is_windows else signum
proc.send_signal(signum)

old_signal_handler = signal.signal(signal.SIGINT, handle_signal)
Expand Down

0 comments on commit d291a5e

Please sign in to comment.