Skip to content

Commit 48df6bc

Browse files
committed
fix: Catch error when trying to get builtins module file path
1 parent ec3e903 commit 48df6bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/pytkdocs/loader.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ def get_class_documentation(self, class_: Type[Any], module: Optional[ModuleType
7676
module = inspect.getmodule(class_)
7777
class_name = class_.__name__
7878
path = f"{module.__name__}.{class_name}"
79-
file_path = module.__file__
79+
try:
80+
file_path = module.__file__
81+
except AttributeError:
82+
self.errors.append(f"Couldn't get file path of module '{str(module)}'")
83+
file_path = ""
8084
try:
8185
signature = inspect.signature(class_)
8286
except ValueError as error:

0 commit comments

Comments
 (0)