@@ -188,10 +188,20 @@ async def connect_stdout():
188
188
189
189
@override
190
190
def _connect_child (self , argv : List [str ]) -> None :
191
+ def get_child_watcher ():
192
+ try :
193
+ return asyncio .get_child_watcher ()
194
+ except AttributeError : # Python 3.14
195
+ return None
196
+
197
+ return None
198
+
191
199
if os .name != 'nt' :
192
200
# see #238, #241
193
- self ._child_watcher = asyncio .get_child_watcher ()
194
- self ._child_watcher .attach_loop (self ._loop )
201
+ watcher = get_child_watcher ()
202
+ if watcher is not None :
203
+ watcher .attach_loop (self ._loop )
204
+ self ._child_watcher = watcher
195
205
196
206
async def create_subprocess ():
197
207
transport : asyncio .SubprocessTransport # type: ignore
@@ -250,7 +260,8 @@ def _close_transport(transport):
250
260
# Windows: for ProactorBasePipeTransport, close() doesn't take in
251
261
# effect immediately (closing happens asynchronously inside the
252
262
# event loop), need to wait a bit for completing graceful shutdown.
253
- if os .name == 'nt' and hasattr (transport , '_sock' ):
263
+ if (sys .version_info < (3 , 13 ) and
264
+ os .name == 'nt' and hasattr (transport , '_sock' )):
254
265
async def wait_until_closed ():
255
266
# pylint: disable-next=protected-access
256
267
while transport ._sock is not None :
0 commit comments