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

Unified Diff: gclient_utils.py

Issue 3164014: Add back stack location to gclient exceptions. (Closed)
Patch Set: whitespace typo Created 10 years, 4 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 b2b009314036ea3e8fb5910e27c78d78966eeb7c..07a8aeba7a31ac9df49f2ed42b6acc9b94b090fd 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -471,8 +471,10 @@ class ExecutionQueue(object):
self.ready_cond.release()
assert not self.running, 'Now guaranteed to be single-threaded'
if self.exceptions:
- # TODO(maruel): Get back the original stack location.
- raise self.exceptions.pop(0)
+ # To get back the stack location correctly, the raise a, b, c form must be
+ # used, passing a tuple as the first argument doesn't work.
+ e = self.exceptions.pop(0)
+ raise e[0], e[1], e[2]
if self.progress:
self.progress.end()
@@ -491,9 +493,9 @@ class ExecutionQueue(object):
exception = None
try:
self.item.run(*self.args, **self.kwargs)
- except Exception, e:
- # TODO(maruel): Catch exception location.
- exception = e
+ except Exception:
+ # Catch exception location.
+ exception = sys.exc_info()
# This assumes the following code won't throw an exception. Bad.
self.parent.ready_cond.acquire()
« 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