mirror of
https://github.com/python/cpython.git
synced 2025-09-08 18:01:44 +00:00
gh-101758: Fix the wasm Buildbots (gh-101943)
They were broken by gh-101920. https://github.com/python/cpython/issues/101758
This commit is contained in:
parent
b365d88465
commit
3dea4ba6c1
2 changed files with 15 additions and 1 deletions
|
@ -16,12 +16,21 @@ import warnings
|
|||
imp = warnings_helper.import_deprecated('imp')
|
||||
import _imp
|
||||
import _testinternalcapi
|
||||
import _xxsubinterpreters as _interpreters
|
||||
try:
|
||||
import _xxsubinterpreters as _interpreters
|
||||
except ModuleNotFoundError:
|
||||
_interpreters = None
|
||||
|
||||
|
||||
OS_PATH_NAME = os.path.__name__
|
||||
|
||||
|
||||
def requires_subinterpreters(meth):
|
||||
"""Decorator to skip a test if subinterpreters are not supported."""
|
||||
return unittest.skipIf(_interpreters is None,
|
||||
'subinterpreters required')(meth)
|
||||
|
||||
|
||||
def requires_load_dynamic(meth):
|
||||
"""Decorator to skip a test if not running under CPython or lacking
|
||||
imp.load_dynamic()."""
|
||||
|
@ -254,6 +263,7 @@ class ImportTests(unittest.TestCase):
|
|||
with self.assertRaises(ImportError):
|
||||
imp.load_dynamic('nonexistent', pathname)
|
||||
|
||||
@requires_subinterpreters
|
||||
@requires_load_dynamic
|
||||
def test_singlephase_multiple_interpreters(self):
|
||||
# Currently, for every single-phrase init module loaded
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue