mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
bpo-40280: Emscripten has no support for subprocesses (GH-29872)
Fixes ``platform`` and ``help()`` on emscripten. Signed-off-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran
This commit is contained in:
parent
226d22ff2d
commit
cb2b3c8d35
2 changed files with 10 additions and 2 deletions
|
@ -607,7 +607,10 @@ def _syscmd_file(target, default=''):
|
||||||
# XXX Others too ?
|
# XXX Others too ?
|
||||||
return default
|
return default
|
||||||
|
|
||||||
import subprocess
|
try:
|
||||||
|
import subprocess
|
||||||
|
except ImportError:
|
||||||
|
return default
|
||||||
target = _follow_symlinks(target)
|
target = _follow_symlinks(target)
|
||||||
# "file" output is locale dependent: force the usage of the C locale
|
# "file" output is locale dependent: force the usage of the C locale
|
||||||
# to get deterministic behavior.
|
# to get deterministic behavior.
|
||||||
|
@ -746,7 +749,10 @@ def from_subprocess():
|
||||||
"""
|
"""
|
||||||
Fall back to `uname -p`
|
Fall back to `uname -p`
|
||||||
"""
|
"""
|
||||||
import subprocess
|
try:
|
||||||
|
import subprocess
|
||||||
|
except ImportError:
|
||||||
|
return None
|
||||||
try:
|
try:
|
||||||
return subprocess.check_output(
|
return subprocess.check_output(
|
||||||
['uname', '-p'],
|
['uname', '-p'],
|
||||||
|
|
|
@ -1556,6 +1556,8 @@ def getpager():
|
||||||
return plainpager
|
return plainpager
|
||||||
if not sys.stdin.isatty() or not sys.stdout.isatty():
|
if not sys.stdin.isatty() or not sys.stdout.isatty():
|
||||||
return plainpager
|
return plainpager
|
||||||
|
if sys.platform == "emscripten":
|
||||||
|
return plainpager
|
||||||
use_pager = os.environ.get('MANPAGER') or os.environ.get('PAGER')
|
use_pager = os.environ.get('MANPAGER') or os.environ.get('PAGER')
|
||||||
if use_pager:
|
if use_pager:
|
||||||
if sys.platform == 'win32': # pipes completely broken in Windows
|
if sys.platform == 'win32': # pipes completely broken in Windows
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue