chiark / gitweb /
documentation/python: improve an assert.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 8 Oct 2020 10:53:54 +0000 (12:53 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 8 Oct 2020 11:11:01 +0000 (13:11 +0200)
documentation/python.py

index af89bfd98fa90d3158764b4ae3c9834b2fe5cfcc..ce35d81eff8eab36a7a959f65913f3c86915c049 100755 (executable)
@@ -2585,7 +2585,7 @@ def run(basedir, config, *, templates=default_templates, search_add_lookahead_ba
     # TODO: rework when we have nested page support
     for i in range(len(page_index)):
         entry = state.name_map[page_index[i]]
-        assert entry.type == EntryType.PAGE
+        assert entry.type == EntryType.PAGE, "page %s already used as %s (%s)" % (page_index[i], entry.type, entry.url)
 
         index_entry = Empty()
         index_entry.kind = 'page'