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): |