File tree Expand file tree Collapse file tree 1 file changed +7
-30
lines changed
pynvim/msgpack_rpc/event_loop Expand file tree Collapse file tree 1 file changed +7
-30
lines changed Original file line number Diff line number Diff line change @@ -188,42 +188,19 @@ async def connect_stdout():
188
188
189
189
@override
190
190
def _connect_child (self , argv : List [str ]) -> None :
191
- def can_use_pidfd ():
192
- # Unix system without pidfd_open?
193
- if not hasattr (os , 'pidfd_open' ):
194
- return False
195
-
196
- # Check that we are not blocked by security policy like SECCOMP
197
- try :
198
- pid = os .getpid ()
199
- fd = os .pidfd_open (pid , 0 )
200
- os .close (fd )
201
- except OSError :
202
- return False
203
-
204
- return True
205
-
206
191
def get_child_watcher ():
207
- if can_use_pidfd ():
208
- try :
209
- from asyncio import PidfdChildWatcher
210
- return PidfdChildWatcher ()
211
- except ImportError :
212
- pass
213
-
214
192
try :
215
- from asyncio import ThreadedChildWatcher
216
- return ThreadedChildWatcher ()
217
- except ImportError :
218
- pass
193
+ return asyncio .get_child_watcher ()
194
+ except AttributeError : # Python 3.14
195
+ return None
219
196
220
- # FIXME Python 3.7, return None if we drop support
221
- return asyncio .get_child_watcher ()
197
+ return None
222
198
223
199
if os .name != 'nt' :
224
200
watcher = get_child_watcher ()
225
- watcher .attach_loop (self ._loop )
226
- self ._child_watcher = watcher
201
+ if watcher is not None :
202
+ watcher .attach_loop (self ._loop )
203
+ self ._child_watcher = watcher
227
204
228
205
async def create_subprocess ():
229
206
transport : asyncio .SubprocessTransport # type: ignore
You can’t perform that action at this time.
0 commit comments