Skip to content

Commit

Permalink
Tests: fix pyright tests for 1.1.340
Browse files Browse the repository at this point in the history
Adapt to the following change from the last pyright release:

(From pylance) All paths are now internally tracked as URIs.
This provides better support for files that are not stored within a
file system. This should be transparent to most pyright users.
  • Loading branch information
Radu Carpa committed Dec 14, 2023
1 parent 4a8c078 commit 33ad63e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/run_pyright/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ class ReportDiagnostic:

@classmethod
def from_dict(cls, obj: dict[str, Any]):
file = obj.get('file')
if file is None:
file = obj.get('uri', {}).get('_filePath')
return cls(
severity=Severity(obj['severity']),
file=obj['file'],
file=file,
rule=obj['rule'],
message=obj['message'],
range_start_line=obj['range']['start']['line'],
Expand Down

0 comments on commit 33ad63e

Please sign in to comment.