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

Unified Diff: gclient.py

Issue 7891061: Fix member lookup to be more stable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Simplify test 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 | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index f568662ba0db7c3811983bbbcef730b330ce4f76..c038738c10d2d7d45793f947651ebf7edb460970 100644
--- a/gclient.py
+++ b/gclient.py
@@ -585,11 +585,15 @@ class Dependency(GClientKeywords, gclient_utils.WorkItem):
def __str__(self):
out = []
for i in ('name', 'url', 'parsed_url', 'safesync_url', 'custom_deps',
- 'custom_vars', 'deps_hooks', '_file_list', 'should_process',
+ 'custom_vars', 'deps_hooks', 'file_list', 'should_process',
'processed', 'hooks_ran', 'deps_parsed', 'requirements'):
- # 'deps_file'
- if self.__dict__[i]:
- out.append('%s: %s' % (i, self.__dict__[i]))
+ # First try the native property if it exists.
+ if hasattr(self, '_' + i):
+ value = getattr(self, '_' + i, False)
+ else:
+ value = getattr(self, i, False)
+ if value:
+ out.append('%s: %s' % (i, value))
for d in self.dependencies:
out.extend([' ' + x for x in str(d).splitlines()])
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698