Skip to content

Commit 4e17856

Browse files
committed
Don't import select on Windows
1 parent b4f6020 commit 4e17856

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/subprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import threading
5252
import warnings
5353
import contextlib
54-
import select
5554
from time import monotonic as _time
5655
import types
5756

@@ -122,6 +121,7 @@ class _del_safe:
122121
WNOHANG = None
123122
ECHILD = errno.ECHILD
124123

124+
import select
125125
import selectors
126126

127127

@@ -798,8 +798,8 @@ def _can_use_kqueue():
798798
kq.close()
799799

800800

801-
_CAN_USE_PIDFD_OPEN = _can_use_pidfd_open()
802-
_CAN_USE_KQUEUE = _can_use_kqueue()
801+
_CAN_USE_PIDFD_OPEN = not _mswindows and _can_use_pidfd_open()
802+
_CAN_USE_KQUEUE = not _mswindows and _can_use_kqueue()
803803

804804

805805
# These are primarily fail-safe knobs for negatives. A True value does not

0 commit comments

Comments
 (0)