Skip to content

Commit

Permalink
Merge pull request #281 from asmeurer/scipy-warning
Browse files Browse the repository at this point in the history
Use a proper warning when a name is not found in a module
  • Loading branch information
Carreau authored Sep 12, 2023
2 parents 5e1e671 + 6544967 commit 93fb951
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 93fb951

Please sign in to comment.