From 1b111338cfe7840feea95e30ea8124063c450c65 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 4 Jan 2022 11:42:19 +0300 Subject: bpo-46238: reuse `_winapi` constants in `asyncio.windows_events` (GH-30352) --- Lib/asyncio/windows_events.py | 6 +++--- Misc/NEWS.d/next/Library/2022-01-03-12-19-10.bpo-46238.lANhCi.rst | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-01-03-12-19-10.bpo-46238.lANhCi.rst diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py index 5e7cd79..8c3d737 100644 --- a/Lib/asyncio/windows_events.py +++ b/Lib/asyncio/windows_events.py @@ -28,8 +28,8 @@ __all__ = ( ) -NULL = 0 -INFINITE = 0xffffffff +NULL = _winapi.NULL +INFINITE = _winapi.INFINITE ERROR_CONNECTION_REFUSED = 1225 ERROR_CONNECTION_ABORTED = 1236 @@ -405,7 +405,7 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop): class IocpProactor: """Proactor implementation using IOCP.""" - def __init__(self, concurrency=0xffffffff): + def __init__(self, concurrency=INFINITE): self._loop = None self._results = [] self._iocp = _overlapped.CreateIoCompletionPort( diff --git a/Misc/NEWS.d/next/Library/2022-01-03-12-19-10.bpo-46238.lANhCi.rst b/Misc/NEWS.d/next/Library/2022-01-03-12-19-10.bpo-46238.lANhCi.rst new file mode 100644 index 0000000..1617b0e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-03-12-19-10.bpo-46238.lANhCi.rst @@ -0,0 +1 @@ +Reuse ``_winapi`` constants in ``asyncio.windows_events``. -- cgit v0.12