summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/spawn.py
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2012-10-10 23:20:12 (GMT)
committerJesus Cea <jcea@jcea.es>2012-10-10 23:20:12 (GMT)
commitd17833d360a7e35675233c4310cbccbd19c9ca79 (patch)
treef0616a9a4cd16aef3952c6915049196c9c7853fe /Lib/distutils/spawn.py
parent9407d502085d0e3d281eb5274149ebca4567034c (diff)
downloadcpython-d17833d360a7e35675233c4310cbccbd19c9ca79.zip
cpython-d17833d360a7e35675233c4310cbccbd19c9ca79.tar.gz
cpython-d17833d360a7e35675233c4310cbccbd19c9ca79.tar.bz2
Closes #16135: Removal of OS/2 support (distutils)
Diffstat (limited to 'Lib/distutils/spawn.py')
-rw-r--r--Lib/distutils/spawn.py24
1 files changed, 1 insertions, 23 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index f58c55f..b1c5a44 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -32,8 +32,6 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
_spawn_posix(cmd, search_path, dry_run=dry_run)
elif os.name == 'nt':
_spawn_nt(cmd, search_path, dry_run=dry_run)
- elif os.name == 'os2':
- _spawn_os2(cmd, search_path, dry_run=dry_run)
else:
raise DistutilsPlatformError(
"don't know how to spawn programs on platform '%s'" % os.name)
@@ -74,26 +72,6 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
raise DistutilsExecError(
"command '%s' failed with exit status %d" % (cmd[0], rc))
-def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
- executable = cmd[0]
- if search_path:
- # either we find one or it stays the same
- executable = find_executable(executable) or executable
- log.info(' '.join([executable] + cmd[1:]))
- if not dry_run:
- # spawnv for OS/2 EMX requires a full path to the .exe
- try:
- rc = os.spawnv(os.P_WAIT, executable, cmd)
- except OSError as exc:
- # this seems to happen when the command isn't found
- raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
- if rc != 0:
- # and this reflects the command running but failing
- log.debug("command '%s' failed with exit status %d" % (cmd[0], rc))
- raise DistutilsExecError(
- "command '%s' failed with exit status %d" % (cmd[0], rc))
-
if sys.platform == 'darwin':
from distutils import sysconfig
_cfg_target = None
@@ -180,7 +158,7 @@ def find_executable(executable, path=None):
paths = path.split(os.pathsep)
base, ext = os.path.splitext(executable)
- if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
+ if (sys.platform == 'win32') and (ext != '.exe'):
executable = executable + '.exe'
if not os.path.isfile(executable):