Skip to content

Commit

Permalink
Update to latest pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Nov 10, 2023
1 parent 73f1a94 commit f3e84a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydantic/_internal/_docs_extraction.py
Expand Up @@ -57,7 +57,7 @@ def _extract_source_from_frame(cls: type[Any]) -> list[str] | None:
pass
else:
block_lines = inspect.getblock(lines[lnum - 1 :])
dedent_source = _dedent_source_lines(block_lines) # type: ignore
dedent_source = _dedent_source_lines(block_lines)
try:
block_tree = ast.parse(dedent_source)
except SyntaxError:
Expand All @@ -68,7 +68,7 @@ def _extract_source_from_frame(cls: type[Any]) -> list[str] | None:
# `_dedent_source_lines` wrapped the class around the workaround function
stmt = stmt.body[0]
if isinstance(stmt, ast.ClassDef) and stmt.name == cls.__name__:
return block_lines # type: ignore
return block_lines

frame = frame.f_back

Expand Down

0 comments on commit f3e84a6

Please sign in to comment.