@@ -188,10 +188,19 @@ 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
- # see #238, #241
193
- self ._child_watcher = asyncio .get_child_watcher ()
194
- self ._child_watcher .attach_loop (self ._loop )
200
+ watcher = get_child_watcher ()
201
+ if watcher is not None :
202
+ watcher .attach_loop (self ._loop )
203
+ self ._child_watcher = watcher
195
204
196
205
async def create_subprocess ():
197
206
transport : asyncio .SubprocessTransport # type: ignore
@@ -250,7 +259,8 @@ def _close_transport(transport):
250
259
# Windows: for ProactorBasePipeTransport, close() doesn't take in
251
260
# effect immediately (closing happens asynchronously inside the
252
261
# event loop), need to wait a bit for completing graceful shutdown.
253
- if os .name == 'nt' and hasattr (transport , '_sock' ):
262
+ if (sys .version_info < (3 , 13 ) and
263
+ os .name == 'nt' and hasattr (transport , '_sock' )):
254
264
async def wait_until_closed ():
255
265
# pylint: disable-next=protected-access
256
266
while transport ._sock is not None :
0 commit comments