mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
asyncio, selectors: Update to the upstream version
This commit is contained in:
parent
049205f646
commit
0c6a34409e
2 changed files with 13 additions and 3 deletions
|
@ -43,9 +43,18 @@ def _fileobj_to_fd(fileobj):
|
||||||
|
|
||||||
|
|
||||||
SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data'])
|
SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data'])
|
||||||
"""Object used to associate a file object to its backing file descriptor,
|
|
||||||
selected event mask and attached data."""
|
|
||||||
|
|
||||||
|
SelectorKey.__doc__ = """SelectorKey(fileobj, fd, events, data)
|
||||||
|
|
||||||
|
Object used to associate a file object to its backing
|
||||||
|
file descriptor, selected event mask, and attached data.
|
||||||
|
"""
|
||||||
|
if sys.version_info >= (3, 5):
|
||||||
|
SelectorKey.fileobj.__doc__ = 'File object registered.'
|
||||||
|
SelectorKey.fd.__doc__ = 'Underlying file descriptor.'
|
||||||
|
SelectorKey.events.__doc__ = 'Events that must be waited for on this file object.'
|
||||||
|
SelectorKey.data.__doc__ = ('''Optional opaque data associated to this file object.
|
||||||
|
For example, this could be used to store a per-client session ID.''')
|
||||||
|
|
||||||
class _SelectorMapping(Mapping):
|
class _SelectorMapping(Mapping):
|
||||||
"""Mapping of file objects to selector keys."""
|
"""Mapping of file objects to selector keys."""
|
||||||
|
|
|
@ -427,9 +427,10 @@ class SubprocessMixin:
|
||||||
|
|
||||||
create = asyncio.create_subprocess_exec(sys.executable, '-c',
|
create = asyncio.create_subprocess_exec(sys.executable, '-c',
|
||||||
'pass', loop=self.loop)
|
'pass', loop=self.loop)
|
||||||
with support.check_no_resource_warning(self):
|
with warnings.catch_warnings(record=True) as warns:
|
||||||
with self.assertRaises(exc):
|
with self.assertRaises(exc):
|
||||||
self.loop.run_until_complete(create)
|
self.loop.run_until_complete(create)
|
||||||
|
self.assertEqual(warns, [])
|
||||||
|
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue