bpo-46238: reuse _winapi constants in asyncio.windows_events (GH-30352)

This commit is contained in:
Nikita Sobolev 2022-01-04 11:42:19 +03:00 committed by GitHub
parent 3aa5242b54
commit 1b111338cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -28,8 +28,8 @@ __all__ = (
) )
NULL = 0 NULL = _winapi.NULL
INFINITE = 0xffffffff INFINITE = _winapi.INFINITE
ERROR_CONNECTION_REFUSED = 1225 ERROR_CONNECTION_REFUSED = 1225
ERROR_CONNECTION_ABORTED = 1236 ERROR_CONNECTION_ABORTED = 1236
@ -405,7 +405,7 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
class IocpProactor: class IocpProactor:
"""Proactor implementation using IOCP.""" """Proactor implementation using IOCP."""
def __init__(self, concurrency=0xffffffff): def __init__(self, concurrency=INFINITE):
self._loop = None self._loop = None
self._results = [] self._results = []
self._iocp = _overlapped.CreateIoCompletionPort( self._iocp = _overlapped.CreateIoCompletionPort(

View file

@ -0,0 +1 @@
Reuse ``_winapi`` constants in ``asyncio.windows_events``.