diff options
Diffstat (limited to 'Lib/distutils/spawn.py')
| -rw-r--r-- | Lib/distutils/spawn.py | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index f66ff93..22e87e8 100644 --- a/Lib/distutils/spawn.py +++ b/Lib/distutils/spawn.py @@ -36,8 +36,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) @@ -82,30 +80,6 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0): raise DistutilsExecError( "command %r failed with exit status %d" % (cmd, 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 - if not DEBUG: - cmd = executable - raise DistutilsExecError( - "command %r failed: %s" % (cmd, exc.args[-1])) - if rc != 0: - # and this reflects the command running but failing - if not DEBUG: - cmd = executable - log.debug("command %r failed with exit status %d" % (cmd, rc)) - raise DistutilsExecError( - "command %r failed with exit status %d" % (cmd, rc)) - if sys.platform == 'darwin': from distutils import sysconfig _cfg_target = None @@ -207,7 +181,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): |
