summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-11-11 07:53:47 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-11-11 07:53:47 (GMT)
commit8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2 (patch)
tree6363b06ab210ef0961fd122be20572a2d5d3754b /Lib/subprocess.py
parent82fdadeba1ed00941aa2bdb0f8e7dff1c16eb2c3 (diff)
downloadcpython-8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2.zip
cpython-8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2.tar.gz
cpython-8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2.tar.bz2
Raise our own SubprocessError rather than a RuntimeError in when dealing with
odd rare errors coming from the subprocess module.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index db0ba19..d52f9a4 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1042,9 +1042,9 @@ class Popen(object):
w9xpopen = os.path.join(os.path.dirname(sys.base_exec_prefix),
"w9xpopen.exe")
if not os.path.exists(w9xpopen):
- raise RuntimeError("Cannot locate w9xpopen.exe, which is "
- "needed for Popen to work with your "
- "shell or platform.")
+ raise SubprocessError(
+ "Cannot locate w9xpopen.exe, which is needed for "
+ "Popen to work with your shell or platform.")
return w9xpopen
@@ -1414,12 +1414,12 @@ class Popen(object):
except ValueError:
warnings.warn(RuntimeWarning(
'Bad exception data: %r' % errpipe_data))
- exception_name = b'RuntimeError'
+ exception_name = b'SubprocessError'
hex_errno = b'0'
err_msg = b'Unknown'
child_exception_type = getattr(
builtins, exception_name.decode('ascii'),
- RuntimeError)
+ SubprocessError)
for fd in (p2cwrite, c2pread, errread):
if fd != -1:
os.close(fd)
@@ -1452,7 +1452,7 @@ class Popen(object):
self.returncode = _WEXITSTATUS(sts)
else:
# Should never happen
- raise RuntimeError("Unknown child exit status!")
+ raise SubprocessError("Unknown child exit status!")
def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,