Index: components/variations/service/generate_ui_string_overrider.py |
diff --git a/components/variations/service/generate_ui_string_overrider.py b/components/variations/service/generate_ui_string_overrider.py |
index 288272cfb5657288af381e752efb2be324298a83..4c8378dd2cd90b148cefc9a13f21c509f1cb2a5b 100755 |
--- a/components/variations/service/generate_ui_string_overrider.py |
+++ b/components/variations/service/generate_ui_string_overrider.py |
@@ -71,6 +71,11 @@ def _GetResourceListFromString(resources_content): |
resources = [Resource(_HashName(name), name, index) for name, index in |
_GetNameIndexPairsIter(resources_content)] |
+ # Deduplicate resources. Some name-index pairs appear in multiple header |
+ # files. Unless deduplicated here, collisions will be raised in |
Alexei Svitkine (slow)
2015/10/27 15:54:31
Nit: Is this specific for chromium_ vs. google_chr
Moe
2015/10/28 00:30:38
Done.
|
+ # _CheckForHashCollisions |
Alexei Svitkine (slow)
2015/10/27 15:54:31
Nit: Add a .
Moe
2015/10/28 00:30:38
Done.
|
+ resources = list(set(resources)) |
+ |
# The default |Resource| order makes |resources| sorted by the hash, then |
# name, then index. |
resources.sort() |
@@ -160,7 +165,7 @@ def _GenerateSourceFileContent(resources_content, namespace, header_filename): |
collisions = _CheckForHashCollisions(hashed_tuples) |
if collisions: |
error_message = "\n".join( |
- ["hash: %i, name: %s" % (i[0], i[1]) for i in sorted(collisions)]) |
+ ["hash: %i, name: %s" % (i.hash, i.name) for i in sorted(collisions)]) |
error_message = ("\nThe following names had hash collisions " |
"(sorted by the hash value):\n%s\n" %(error_message)) |
raise HashCollisionError(error_message) |