mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Change CheckCall behavior when print_error=False
We now return the stderr half of the tuple. This required a clean up of any usage of CheckCall and GIT.Capture. Patch contributed by Nasser Grainawi <nasser@codeaurora.org> Review URL: http://codereview.chromium.org/551215 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@37650 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -28,12 +28,13 @@ import xml.parsers.expat
|
||||
|
||||
class CheckCallError(OSError):
|
||||
"""CheckCall() returned non-0."""
|
||||
def __init__(self, command, cwd, retcode, stdout):
|
||||
OSError.__init__(self, command, cwd, retcode, stdout)
|
||||
def __init__(self, command, cwd, retcode, stdout, stderr=None):
|
||||
OSError.__init__(self, command, cwd, retcode, stdout, stderr)
|
||||
self.command = command
|
||||
self.cwd = cwd
|
||||
self.retcode = retcode
|
||||
self.stdout = stdout
|
||||
self.stderr = stderr
|
||||
|
||||
|
||||
def CheckCall(command, cwd=None, print_error=True):
|
||||
@@ -50,12 +51,12 @@ def CheckCall(command, cwd=None, print_error=True):
|
||||
shell=sys.platform.startswith('win'),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=stderr)
|
||||
output = process.communicate()[0]
|
||||
std_out, std_err = process.communicate()
|
||||
except OSError, e:
|
||||
raise CheckCallError(command, cwd, e.errno, None)
|
||||
if process.returncode:
|
||||
raise CheckCallError(command, cwd, process.returncode, output)
|
||||
return output
|
||||
raise CheckCallError(command, cwd, process.returncode, std_out, std_err)
|
||||
return std_out, std_err
|
||||
|
||||
|
||||
def SplitUrlRevision(url):
|
||||
|
||||
Reference in New Issue
Block a user