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

Unified Diff: gclient.py

Issue 1627009: Workaround output variance in pprint.pformat. (Closed)
Patch Set: Created 10 years, 8 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 b1dc49a82d5a0ef3a054d65c67d843528178933c..498848af045c59b6c7f2dfa8f96410e40dfd8090 100644
--- a/gclient.py
+++ b/gclient.py
@@ -399,7 +399,12 @@ class GClient(object):
Args:
entries: A sequence of solution names.
"""
- text = "entries = \\\n" + pprint.pformat(entries, 2) + '\n'
+ # Sometimes pprint.pformat will use {', sometimes it'll use { ' ... It
+ # makes testing a bit too fun.
+ result = pprint.pformat(entries, 2)
+ if result.startswith('{\''):
+ result[0:2] = '{ \''
+ text = "entries = \\\n" + result + '\n'
file_path = os.path.join(self._root_dir, self._options.entries_filename)
gclient_utils.FileWrite(file_path, text)
« 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