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

Unified Diff: gclient_utils.py

Issue 7885008: Fix the case where a dep not processed could be set as a requirement. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: comment 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 | « gclient.py ('k') | tests/gclient_test.py » ('j') | 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 350de22e812b53988203d316905c2c6ddecbfa0f..d668c5372345a0196ea1cfcb9cc117519383c110 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -454,10 +454,11 @@ def GetGClientRootAndEntries(path=None):
class WorkItem(object):
"""One work item."""
- # A list of string, each being a WorkItem name.
- requirements = []
- # A unique string representing this work item.
- name = None
+ def __init__(self):
+ # A list of string, each being a WorkItem name.
+ self.requirements = []
+ # A unique string representing this work item.
+ self.name = None
def run(self, work_queue):
"""work_queue is passed as keyword argument so it should be
@@ -548,7 +549,20 @@ class ExecutionQueue(object):
# We're done.
break
# We need to poll here otherwise Ctrl-C isn't processed.
- self.ready_cond.wait(10)
+ try:
+ self.ready_cond.wait(10)
+ except KeyboardInterrupt:
+ # Help debugging by printing some information:
+ print >> sys.stderr, (
+ ('\nAllowed parallel jobs: %d\n# queued: %d\nRan: %s\n'
+ 'Running: %d') % (
+ self.jobs,
+ len(self.queued),
+ ', '.join(self.ran),
+ len(self.running)))
+ for i in self.queued:
+ print >> sys.stderr, '%s: %s' % (i.name, ', '.join(i.requirements))
+ raise
# Something happened: self.enqueue() or a thread terminated. Loop again.
finally:
self.ready_cond.release()
« no previous file with comments | « gclient.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698