mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio: sync with Tulip
* Tulip issue 194: Don't use sys.getrefcount() in unit tests * signal.set_wakeup_fd() can now raise an OSError on Python 3.5
This commit is contained in:
parent
8966759b03
commit
c4c464911a
3 changed files with 13 additions and 14 deletions
|
@ -74,7 +74,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
# event loop running in another thread cannot add a signal
|
||||
# handler.
|
||||
signal.set_wakeup_fd(self._csock.fileno())
|
||||
except ValueError as exc:
|
||||
except (ValueError, OSError) as exc:
|
||||
raise RuntimeError(str(exc))
|
||||
|
||||
handle = events.Handle(callback, args, self)
|
||||
|
@ -93,7 +93,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
if not self._signal_handlers:
|
||||
try:
|
||||
signal.set_wakeup_fd(-1)
|
||||
except ValueError as nexc:
|
||||
except (ValueError, OSError) as nexc:
|
||||
logger.info('set_wakeup_fd(-1) failed: %s', nexc)
|
||||
|
||||
if exc.errno == errno.EINVAL:
|
||||
|
@ -138,7 +138,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
if not self._signal_handlers:
|
||||
try:
|
||||
signal.set_wakeup_fd(-1)
|
||||
except ValueError as exc:
|
||||
except (ValueError, OSError) as exc:
|
||||
logger.info('set_wakeup_fd(-1) failed: %s', exc)
|
||||
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue