mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #19850: asyncio: Set SA_RESTART when registering a signal handler to
limit EINTR occurrences.
This commit is contained in:
parent
0a956f1aec
commit
74e7cf3f46
1 changed files with 2 additions and 0 deletions
|
@ -74,6 +74,8 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
|
||||
try:
|
||||
signal.signal(sig, self._handle_signal)
|
||||
# Set SA_RESTART to limit EINTR occurrences.
|
||||
signal.siginterrupt(sig, False)
|
||||
except OSError as exc:
|
||||
del self._signal_handlers[sig]
|
||||
if not self._signal_handlers:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue