From 40fef4348876b361c406f0a7804ebfb7839a18d1 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 7 Mar 2025 11:58:39 -0500 Subject: [PATCH] tools: Fix assert when all file contents are excluded (see #3836) The full contents of a file may be excluded at certain API versions. --- tools/cef_api_hash.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/cef_api_hash.py b/tools/cef_api_hash.py index a59c55888..8f271ee6e 100644 --- a/tools/cef_api_hash.py +++ b/tools/cef_api_hash.py @@ -343,8 +343,9 @@ class CefApiHasher: 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']}")