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 35c8c65 commit 6839495
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -269,7 +269,7 @@ jobs:
node-version: '18'

- name: install pyright
run: npm install -g pyright@1.1.322 # try to keep this in sync with .pre-commit-config.yaml
run: npm install -g pyright@1.1.335 # try to keep this in sync with .pre-commit-config.yaml

- name: run pyright tests
run: make test-pyright
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -36,4 +36,4 @@ repos:
types: [python]
language: node
pass_filenames: false
additional_dependencies: ["pyright@1.1.322"]
additional_dependencies: ["pyright@1.1.335"]
2 changes: 1 addition & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 6839495

Please sign in to comment.