Skip to content

Commit

Permalink
Use SIGINT only to catch Ctrl+C
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Mar 24, 2022
1 parent 15c68ea commit 2fd2ab7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Lib/asyncio/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ def run(self, coro, *, context=None):
context = self._context
task = self._loop.create_task(coro, context=context)

if sys.platform == "win32":
signum = signal.SIGBREAK
else:
signum = signal.SIGINT
# if sys.platform == "win32":
# signum = signal.SIGBREAK
# else:
# signum = signal.SIGINT
signum = signal.SIGINT
if (threading.current_thread() is threading.main_thread()
and signal.getsignal(signum) is signal.default_int_handler
):
Expand Down

0 comments on commit 2fd2ab7

Please sign in to comment.