diff --git a/Lib/platform.py b/Lib/platform.py index cc2db9870d..ac4e3c538f 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -748,7 +748,7 @@ def _syscmd_uname(option, default=''): """ Interface to the system's uname command. """ - if sys.platform in ('dos', 'win32', 'win16'): + if sys.platform in ('dos', 'win32', 'win16', 'emscripten'): # XXX Others too ? return default try: @@ -771,7 +771,7 @@ def _syscmd_file(target, default=''): default in case the command should fail. """ - if sys.platform in ('dos', 'win32', 'win16'): + if sys.platform in ('dos', 'win32', 'win16', 'emscripten'): # XXX Others too ? return default target = _follow_symlinks(target) diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 0bd8288e27..bab3f95c7d 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -189,9 +189,9 @@ def clear_caches(): import gc # Clear the warnings registry, so they can be displayed again - for mod in sys.modules.values(): - if hasattr(mod, '__warningregistry__'): - del mod.__warningregistry__ + # for mod in list(sys.modules.values()): + # if hasattr(mod, '__warningregistry__'): + # del mod.__warningregistry__ # Flush standard output, so that buffered data is sent to the OS and # associated Python objects are reclaimed. diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index bf899a9e4d..8722549fd8 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -53,11 +53,11 @@ def setup_tests(ns): # (site.py absolutize them), the __file__ and __path__ will be absolute too. # Therefore it is necessary to absolutize manually the __file__ and __path__ of # the packages to prevent later imports to fail when the CWD is different. - for module in sys.modules.values(): - if hasattr(module, '__path__'): + for module in list(sys.modules.values()): + if '__path__' in module.__dict__: for index, path in enumerate(module.__path__): module.__path__[index] = os.path.abspath(path) - if hasattr(module, '__file__'): + if '__file__' in module.__dict__: module.__file__ = os.path.abspath(module.__file__) # MacOSX (a.k.a. Darwin) has a default stack size that is too small diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py index ca5f9c20dd..97934039ee 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py @@ -11,6 +11,7 @@ import subprocess import py_compile import contextlib import shutil +import unittest import zipfile from importlib.util import source_from_cache @@ -37,6 +38,8 @@ def interpreter_requires_environment(): situation. PYTHONPATH or PYTHONUSERSITE are other common environment variables that might impact whether or not the interpreter can start. """ + raise unittest.SkipTest('no subprocess') + global __cached_interp_requires_environment if __cached_interp_requires_environment is None: # Try running an interpreter with -E to see if it works or not. @@ -165,6 +168,8 @@ def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw): kw is extra keyword args to pass to subprocess.Popen. Returns a Popen object. """ + raise unittest.SkipTest("no subprocess") + cmd_line = [sys.executable, '-E'] cmd_line.extend(args) # Under Fedora (?), GNU readline can output junk on stderr when initialized, diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py index 55faf4c427..b2201c09e7 100644 --- a/Lib/test/test_code.py +++ b/Lib/test/test_code.py @@ -104,7 +104,10 @@ consts: ('None',) import inspect import sys -import threading +try: + import threading +except ImportError: + import dummy_threading as threading import unittest import weakref try: