Skip to content

Commit 4b75032

Browse files
authored
pythongh-114807: multiprocessing: don't raise ImportError if _multiprocessing is missing (python#114808)
`_multiprocessing` is only used under the `if _winapi:` block, this moves the import to be within the `_winapi` ImportError handling try/except for equivalent treatment.
1 parent 1b89591 commit 4b75032

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/multiprocessing/connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import tempfile
2020
import itertools
2121

22-
import _multiprocessing
2322

2423
from . import util
2524

@@ -28,6 +27,7 @@
2827
_ForkingPickler = reduction.ForkingPickler
2928

3029
try:
30+
import _multiprocessing
3131
import _winapi
3232
from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE
3333
except ImportError:

0 commit comments

Comments
 (0)