Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed May 20, 2024
1 parent 83fefbf commit 4705f0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ def add_implicit_module_attrs(self, file_node: MypyFile) -> None:
str_type: Type | None = self.named_type_or_none("builtins.str")
if str_type is None:
str_type = UnboundType("builtins.str")
inst: Type | None
for name, t in implicit_module_attrs.items():
if name == "__doc__":
typ: Type = str_type
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ print(math.__spec__.name)
print(type(math.__spec__.loader))
print(type(math.__dict__))
print(type(math.__doc__ or ''))
print(type(math.__spec__))
print(type(math.__spec__).__name__)
print(math.__class__)
[out]
<class 'NoneType'>
Expand All @@ -122,7 +122,7 @@ math
<class '_frozen_importlib_external.ExtensionFileLoader'>
<class 'dict'>
<class 'str'>
<class '_frozen_importlib.ModuleSpec'>
ModuleSpec
<class 'module'>

[case testSpecialAttributes]
Expand Down

0 comments on commit 4705f0b

Please sign in to comment.