diff --git a/Lib/platform.py b/Lib/platform.py index 20f9817f4f..bcf96874c0 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/support/script_helper.py b/Lib/test/support/script_helper.py index 64b25aab80..7cf67fd149 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py @@ -9,6 +9,7 @@ import os.path import subprocess import py_compile import zipfile +import unittest from importlib.util import source_from_cache from test.support import make_legacy_pyc, strip_python_stderr @@ -34,6 +35,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: # If PYTHONHOME is set, assume that we need it @@ -172,6 +175,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] if not interpreter_requires_environment(): cmd_line.append('-E') 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: diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 1fc4de11e1..e6c91707ae 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -10,7 +10,10 @@ import py_compile import random import stat import sys -import threading +try: + import threading +except ImportError: + import dummy_threading as threading import time import unittest import unittest.mock as mock diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -13,6 +13,7 @@ from test import support from test.support import _4G, bigmemtest from test.support.script_helper import assert_python_ok +import unittest gzip = support.import_module('gzip') @@ -691,6 +692,7 @@ data = b'This is a simple test with gzip' def test_decompress_stdin_stdout(self): + raise unittest.SkipTest('no subprocess') with io.BytesIO() as bytes_io: with gzip.GzipFile(fileobj=bytes_io, mode='wb') as gzip_file: gzip_file.write(self.data) @@ -727,6 +729,7 @@ @create_and_remove_directory(TEMPDIR) def test_compress_stdin_outfile(self): + raise unittest.SkipTest('no subprocess') args = sys.executable, '-m', 'gzip' with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc: out, err = proc.communicate(self.data)