From d291a5e7f9f534e69c1c7222be624443bf0034fd Mon Sep 17 00:00:00 2001 From: Julien CAPUL Date: Wed, 14 Dec 2022 10:17:27 +0100 Subject: [PATCH] convert SIGINT to CTRL_C_EVENT in signal handler when on windows send_signal() implementation on windows only supports SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT Ref: nat-n/poethepoet#42 --- poethepoet/executor/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/poethepoet/executor/base.py b/poethepoet/executor/base.py index bb86040b..afd4d1e7 100644 --- a/poethepoet/executor/base.py +++ b/poethepoet/executor/base.py @@ -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)