Skip to content

Commit d611358

Browse files
committed
Pass test
1 parent 830bf5c commit d611358

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/sphinx_autodoc_typehints/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,10 @@ def get_all_type_hints(autodoc_mock_imports: list[str], obj: Any, name: str) ->
358358

359359

360360
_TYPE_GUARD_IMPORT_RE = re.compile(r"\nif (typing.)?TYPE_CHECKING:[^\n]*([\s\S]*?)(?=\n\S)")
361-
_TYPE_GUARD_IMPORTS_RESOLVED = set()
362361

363362

364363
def _resolve_type_guarded_imports(autodoc_mock_imports: list[str], obj: Any) -> None:
365-
if hasattr(obj, "__module__") and obj.__module__ not in _TYPE_GUARD_IMPORTS_RESOLVED:
366-
_TYPE_GUARD_IMPORTS_RESOLVED.add(obj.__module__)
364+
if hasattr(obj, "__module__"):
367365
if obj.__module__ not in sys.builtin_module_names:
368366
module = inspect.getmodule(obj)
369367
if module:

0 commit comments

Comments
 (0)