chiark / gitweb /
documentation/python: a futile attempt to improve a firing assert.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 May 2020 08:17:48 +0000 (10:17 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 May 2020 10:04:40 +0000 (12:04 +0200)
Continuation of f45a8b060c5cd875da1fe66982025627c2747359.

documentation/python.py

index 08ebcc83772090966568c32aaec9c10da01c6894..acc614d6ef5d6860af7787daa6c8b8e38b030588 100755 (executable)
@@ -383,8 +383,8 @@ 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 previous_entry.object == class_: break
-        else: assert False
+            if 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
         return