From 0b6497481836a8e9ac57b4e8ee7cb208a2a371d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Jan 2022 19:18:36 +0100 Subject: [PATCH] documentation/python: ignore enum values when checking for duplicates. The test now passes again. --- documentation/python.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/documentation/python.py b/documentation/python.py index d29ee660..ce56d196 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -400,7 +400,10 @@ def crawl_class(state: State, path: List[str], class_): # one would hope so we can't just assert. if id(class_) in state.crawled: for name, previous_entry in state.name_map.items(): - if id(previous_entry.object) == id(class_): break + # Enum value entries don't have the object property, don't try to + # match them + if hasattr(previous_entry, 'object') and id(previous_entry.object) == id(class_): + break else: assert False, "%s marked as crawled but can't find it" % '.'.join(path) logging.error("Class %s previously found in %s, only one occurence will be chosen. Ensure each class is exposed only in a single module for generating correct documentation.", '.'.join(path), '.'.join(previous_entry.path)) state.name_map['.'.join(path)] = previous_entry -- 2.30.2