gh-114807: multiprocessing: don't raise ImportError if _multiprocessing is missing (#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.
This commit is contained in:
Hood Chatham 2024-02-11 01:59:50 -08:00 committed by GitHub
parent 1b89591474
commit 4b75032c88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,6 @@ import time
import tempfile
import itertools
import _multiprocessing
from . import util
@ -28,6 +27,7 @@ from .context import reduction
_ForkingPickler = reduction.ForkingPickler
try:
import _multiprocessing
import _winapi
from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE
except ImportError: