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

Unified Diff: tools/metrics/histograms/update_histogram_enum.py

Issue 2835733002: Readdress use_counter_feature_enum issue (Closed)
Patch Set: Created 3 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
Index: tools/metrics/histograms/update_histogram_enum.py
diff --git a/tools/metrics/histograms/update_histogram_enum.py b/tools/metrics/histograms/update_histogram_enum.py
index f0a29e0fe91c7aaf1c0500e82c572c0d836c4059..9cd55ff997280dcd59045b38aa5f26b0f92cdf78 100644
--- a/tools/metrics/histograms/update_histogram_enum.py
+++ b/tools/metrics/histograms/update_histogram_enum.py
@@ -38,8 +38,8 @@ def Log(message):
def ReadHistogramValues(filename, start_marker, end_marker, strip_k_prefix):
- """Returns a dictionary of enum values and a pair of labels that have the same
- enum values, read from a C++ file.
+ """Returns a dictionary of enum values, read from a C++ file; or raises an
+ exception if a pair of labels have the same enum values.
Args:
filename: The unix-style path (relative to src/) of the file to open.
@@ -89,13 +89,13 @@ def ReadHistogramValues(filename, start_marker, end_marker, strip_k_prefix):
continue
# If two enum labels have the same value
if enum_value in result:
- return result, (result[enum_value], label)
+ raise Exception(result[enum_value], label)
if strip_k_prefix:
assert label.startswith('k'), "Enum " + label + " should start with 'k'."
label = label[1:]
result[enum_value] = label
enum_value += 1
- return result, None
+ return result
def CreateEnumItemNode(document, value, label):

Powered by Google App Engine
This is Rietveld 408576698