Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: gclient_utils.py

Issue 7839038: Make gclient_utils.CheckCallError inherit from subprocess2.CalledProcessError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 1f4fdf22c5a5899023dfcad48a200b1204bade2f..5e5ea405993e62436187ec16a7070401600f8cf1 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -15,6 +15,8 @@ import sys
import threading
import time
+import subprocess2
+
def hack_subprocess():
"""subprocess functions may throw exceptions when used in multiple threads.
@@ -29,28 +31,15 @@ class Error(Exception):
pass
-class CheckCallError(OSError, Error):
+class CheckCallError(subprocess2.CalledProcessError, Error):
"""CheckCall() returned non-0."""
- def __init__(self, command, cwd, returncode, stdout, stderr=None):
- OSError.__init__(self, command, cwd, returncode)
- Error.__init__(self, command)
- self.command = command
- self.cwd = cwd
- self.returncode = returncode
- self.stdout = stdout
- self.stderr = stderr
+ def __init__(self, cmd, cwd, returncode, stdout, stderr=None):
+ subprocess2.CalledProcessError.__init__(
+ self, returncode, cmd, cwd, stdout, stderr)
+ Error.__init__(self, cmd)
def __str__(self):
- out = ' '.join(self.command)
- if self.cwd:
- out += ' in ' + self.cwd
- if self.returncode is not None:
- out += ' returned %d' % self.returncode
- if self.stdout is not None:
- out += '\nstdout: %s\n' % self.stdout
- if self.stderr is not None:
- out += '\nstderr: %s\n' % self.stderr
- return out
+ return subprocess2.CalledProcessError.__str__(self)
def Popen(args, **kwargs):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698