[Python-checkins] bpo-46238: reuse `_winapi` constants in `asyncio.windows_events` (GH-30352)

asvetlov webhook-mailer at python.org
Tue Jan 4 03:42:35 EST 2022


https://github.com/python/cpython/commit/1b111338cfe7840feea95e30ea8124063c450c65
commit: 1b111338cfe7840feea95e30ea8124063c450c65
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: asvetlov <andrew.svetlov at gmail.com>
date: 2022-01-04T10:42:19+02:00
summary:

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

files:
A Misc/NEWS.d/next/Library/2022-01-03-12-19-10.bpo-46238.lANhCi.rst
M Lib/asyncio/windows_events.py

diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 5e7cd795895d6..8c3d73705e3c8 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -28,8 +28,8 @@
 )
 
 
-NULL = 0
-INFINITE = 0xffffffff
+NULL = _winapi.NULL
+INFINITE = _winapi.INFINITE
 ERROR_CONNECTION_REFUSED = 1225
 ERROR_CONNECTION_ABORTED = 1236
 
@@ -405,7 +405,7 @@ async def _make_subprocess_transport(self, protocol, args, shell,
 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 0000000000000..1617b0ed0538a
--- /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``.



More information about the Python-checkins mailing list