MCPcopy Index your code
hub / github.com/python/cpython / CalledProcessError

Class CalledProcessError

Lib/subprocess.py:132–166  ·  view source on GitHub ↗

Raised when run() is called with check=True and the process returns a non-zero exit status. Attributes: cmd, returncode, stdout, stderr, output

Source from the content-addressed store, hash-verified

130
131
132class CalledProcessError(SubprocessError):
133 """Raised when run() is called with check=True and the process
134 returns a non-zero exit status.
135
136 Attributes:
137 cmd, returncode, stdout, stderr, output
138 """
139 def __init__(self, returncode, cmd, output=None, stderr=None):
140 self.returncode = returncode
141 self.cmd = cmd
142 self.output = output
143 self.stderr = stderr
144
145 def __str__(self):
146 if self.returncode and self.returncode < 0:
147 try:
148 return "Command '%s' died with %r." % (
149 self.cmd, signal.Signals(-self.returncode))
150 except ValueError:
151 return "Command '%s' died with unknown signal %d." % (
152 self.cmd, -self.returncode)
153 else:
154 return "Command '%s' returned non-zero exit status %d." % (
155 self.cmd, self.returncode)
156
157 @property
158 def stdout(self):
159 """Alias for output attribute, to match stderr"""
160 return self.output
161
162 @stdout.setter
163 def stdout(self, value):
164 # There's no obvious reason to set this, but allow it anyway so
165 # .stdout is a transparent alias for .output
166 self.output = value
167
168
169class TimeoutExpired(SubprocessError):

Callers 6

async_check_outputFunction · 0.90
logcat_taskFunction · 0.90
gradle_taskFunction · 0.90
check_callFunction · 0.85
check_returncodeMethod · 0.85
runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…