mirror of
https://github.com/python/cpython.git
synced 2025-11-10 14:31:24 +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:
|
try:
|
||||||
signal.signal(sig, self._handle_signal)
|
signal.signal(sig, self._handle_signal)
|
||||||
|
# Set SA_RESTART to limit EINTR occurrences.
|
||||||
|
signal.siginterrupt(sig, False)
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
del self._signal_handlers[sig]
|
del self._signal_handlers[sig]
|
||||||
if not self._signal_handlers:
|
if not self._signal_handlers:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue