Skip to content

Commit

Permalink
tools: Fix assert when all file contents are excluded (see #3836)
Browse files Browse the repository at this point in the history
The full contents of a file may be excluded at certain API versions.
  • Loading branch information
magreenblatt committed Mar 7, 2025
1 parent f3023f8 commit 059f244
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/cef_api_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ def calculate(self, api_version: str, added_defines: list) -> Dict[str, str]:
else:
content_objects = self.file_content_objs.get(filename, None)

assert content_objects, f'content_objects is None for {filename}'
objects.extend(content_objects)
# May be None if the full contents of the file are excluded at certain API versions.
if not content_objects is None:
objects.extend(content_objects)

# objects will be sorted including filename to make stable hashes
objects = sorted(objects, key=lambda o: f"{o['name']}@{o['filename']}")
Expand Down

0 comments on commit 059f244

Please sign in to comment.