Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Aug 27, 2024
1 parent 720521d commit be98a83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pdoc/doc_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def _import_stub_file(module_name: str, stub_file: Path) -> types.ModuleType:
try:
loader = importlib.machinery.SourceFileLoader(module_name, str(stub_file))
spec = importlib.util.spec_from_file_location(module_name, stub_file, loader=loader)
assert spec is not None
m = importlib.util.module_from_spec(spec)
loader.exec_module(m)
return m
Expand Down
8 changes: 8 additions & 0 deletions test/testdata/type_stubs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any
from typing import Iterable
from typing import overload

from ._utils import ImportedClass

def func(x: str, y: Any, z: "Iterable[str]") -> int: ...
Expand All @@ -22,3 +23,10 @@ class Class:
def overloaded(self, x: int) -> int: ...
@overload
def overloaded(self, x: str) -> str: ...

__all__ = [
"func",
"var",
"Class",
"ImportedClass",
]

0 comments on commit be98a83

Please sign in to comment.