bpo-40280: Emscripten has no support for subprocesses (GH-29872) · python/cpython@cb2b3c8

Original file line numberDiff line numberDiff line change

@@ -607,7 +607,10 @@ def _syscmd_file(target, default=''):

607607

# XXX Others too ?

608608

return default

609609
610-

import subprocess

610+

try:

611+

import subprocess

612+

except ImportError:

613+

return default

611614

target = _follow_symlinks(target)

612615

# "file" output is locale dependent: force the usage of the C locale

613616

# to get deterministic behavior.

@@ -746,7 +749,10 @@ def from_subprocess():

746749

"""

747750

Fall back to `uname -p`

748751

"""

749-

import subprocess

752+

try:

753+

import subprocess

754+

except ImportError:

755+

return None

750756

try:

751757

return subprocess.check_output(

752758

['uname', '-p'],