mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-40280: Misc fixes for wasm32-emscripten (GH-30722)
This commit is contained in:
parent
ef3ef6fa43
commit
c02e860ee7
9 changed files with 34 additions and 6 deletions
|
@ -3,6 +3,12 @@ from test import support
|
|||
from test.support import warnings_helper
|
||||
import os
|
||||
import sys
|
||||
import types
|
||||
|
||||
try:
|
||||
import _multiprocessing
|
||||
except ModuleNotFoundError:
|
||||
_multiprocessing = None
|
||||
|
||||
|
||||
class NoAll(RuntimeError):
|
||||
|
@ -14,6 +20,17 @@ class FailedImport(RuntimeError):
|
|||
|
||||
class AllTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# concurrent.futures uses a __getattr__ hook. Its __all__ triggers
|
||||
# import of a submodule, which fails when _multiprocessing is not
|
||||
# available.
|
||||
if _multiprocessing is None:
|
||||
sys.modules["_multiprocessing"] = types.ModuleType("_multiprocessing")
|
||||
|
||||
def tearDown(self):
|
||||
if _multiprocessing is None:
|
||||
sys.modules.pop("_multiprocessing")
|
||||
|
||||
def check_all(self, modname):
|
||||
names = {}
|
||||
with warnings_helper.check_warnings(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue