From f19ee26f7543ee9ce0ebd8fb53e4287f4068cd92 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 25 Nov 2019 18:09:02 +0100 Subject: [PATCH] documentation/python: fix a cyclic crawl corner case in Python 3.6. --- documentation/python.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documentation/python.py b/documentation/python.py index 21bb2e9a..8f32c501 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -399,6 +399,10 @@ def crawl_class(state: State, path: List[str], class_): # name_map) if type == EntryType.CLASS: if name in ['__base__', '__class__']: continue # TODO + # Classes derived from typing.Generic in 3.6 have a _gorg property + # that causes a crawl cycle, firing an assert in crawl_class(). Not + # present from 3.7 onwards. + if sys.version_info < (3, 7) and class_.__base__ is typing.Generic and name == '_gorg': continue if is_underscored_and_undocumented(state, type, subpath, object.__doc__): continue crawl_class(state, subpath, object) -- 2.30.2