Skip to content

Commit 307c8ad

Browse files
committed
Fix: add check for nonfunctional multiprocessing (fixes #9047)
Add an additional check for a special case where semlock_open seemingly exists but doesn't work (OSError is raised because function is not implemented)
1 parent 58d8c2d commit 307c8ad

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

news/9047.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Check for operativeness of multiprocessing. This takes care of systems where multiprocessing seems available but really is not.

src/pip/_internal/utils/parallel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@
4343
except ImportError:
4444
LACK_SEM_OPEN = True
4545
else:
46-
LACK_SEM_OPEN = False
46+
try:
47+
p = ProcessPool()
48+
p.terminate()
49+
del p
50+
except OSError:
51+
LACK_SEM_OPEN = True
52+
else:
53+
LACK_SEM_OPEN = False
4754

4855
# Incredibly large timeout to work around bpo-8296 on Python 2.
4956
TIMEOUT = 2000000

0 commit comments

Comments
 (0)