Fix #7727: autosummary raises PycodeError for namespace python package

This commit is contained in:
Takeshi KOMIYA
2020-11-09 02:06:14 +09:00
parent 1193d83166
commit 787444ff18
2 changed files with 3 additions and 1 deletions

View File

@@ -16,6 +16,8 @@ Features added
Bugs fixed
----------
* #7727: autosummary: raise PycodeError when documenting python package
without __init__.py
* #8364: C, properly initialize attributes in empty symbols.
Testing

View File

@@ -691,7 +691,7 @@ def import_ivar_by_name(name: str, prefixes: List[str] = [None]) -> Tuple[str, A
analyzer = ModuleAnalyzer.for_module(modname)
if (qualname, attr) in analyzer.find_attr_docs():
return real_name + "." + attr, INSTANCEATTR, obj, modname
except (ImportError, ValueError):
except (ImportError, ValueError, PycodeError):
pass
raise ImportError