Skip to content

Commit

Permalink
Use a proper warning when a name is not found in a module
Browse files Browse the repository at this point in the history
Closes #278
  • Loading branch information
asmeurer committed Sep 7, 2023
1 parent 5e1e671 commit 6544967
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion papyri/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ def __init__(self, root: ModuleType, others: List[ModuleType]):
self._open_list = [(root, [root.__name__])]
for o in others:
self._open_list.append((o, o.__name__.split(".")))
self.log = logging.getLogger("papyri")

def scan(self) -> None:
"""
Expand Down Expand Up @@ -697,7 +698,7 @@ def visit_ModuleType(self, mod, stack):
for k in dir(mod):
# TODO: scipy 1.8 workaround, remove.
if not hasattr(mod, k):
print_(f"scipy 1.8 workaround : ({mod.__name__!r},{k!r}),")
self.log.warning(f"Name not found in module: {mod.__name__}.{k}")
continue
self._open_list.append((getattr(mod, k), stack + [k]))

Expand Down

0 comments on commit 6544967

Please sign in to comment.