From d73fcbdbac376582ca22643afd69ecda24585bd7 2024-02-03 13:43:07 From: M Bussonnier Date: 2024-02-03 13:43:07 Subject: [PATCH] IPython/utils/_process_emscripten.py: New (#14316) From https://github.com/ipython/ipython/pull/14312#issuecomment-1917947192 @hoodmane --- diff --git a/IPython/utils/_process_emscripten.py b/IPython/utils/_process_emscripten.py new file mode 100644 index 0000000..c029eb8 --- /dev/null +++ b/IPython/utils/_process_emscripten.py @@ -0,0 +1,21 @@ +"""Emscripten-specific implementation of process utilities. + +This file is only meant to be imported by process.py, not by end-users. +""" + + +def system(cmd): + raise OSError("Not available") + + +def getoutput(cmd): + raise OSError("Not available") + + +def check_pid(cmd): + raise OSError("Not available") + + +def arg_split(s, posix=False, strict=True): + """This one could be made to work but it's not clear if it would be useful...""" + raise OSError("Not available") diff --git a/IPython/utils/process.py b/IPython/utils/process.py index 489b7c1..f50cf9b 100644 --- a/IPython/utils/process.py +++ b/IPython/utils/process.py @@ -15,6 +15,8 @@ if sys.platform == 'win32': from ._process_win32 import system, getoutput, arg_split, check_pid elif sys.platform == 'cli': from ._process_cli import system, getoutput, arg_split, check_pid +elif sys.platform == "emscripten": + from ._process_emscripten import system, getoutput, arg_split, check_pid else: from ._process_posix import system, getoutput, arg_split, check_pid diff --git a/setup.cfg b/setup.cfg index 31606a8..de77754 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,7 +34,7 @@ install_requires = exceptiongroup; python_version<'3.11' jedi>=0.16 matplotlib-inline - pexpect>4.3; sys_platform != "win32" + pexpect>4.3; sys_platform != "win32" and sys_platform != "emscripten" prompt_toolkit>=3.0.41,<3.1.0 pygments>=2.4.0 stack_data