File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def read_json(path: Path) -> dict[str, Any]:
1919 dictionary.
2020 """
2121 try :
22- properties : dict [ str , Any ] = loads (path .read_text ())
22+ properties : Any = loads (path .read_text ())
2323 except JSONDecodeError as error :
2424 raise JSONDecodeError (
2525 f"The path { path } couldn't be parsed as JSON. Is there a typo or other "
@@ -28,11 +28,13 @@ def read_json(path: Path) -> dict[str, Any]:
2828 pos = error .pos ,
2929 ) from None # To hide the original traceback
3030
31- if not isinstance (properties , dict ): # pyright: ignore
31+ if not isinstance (properties , dict ):
3232 raise TypeError (
3333 f"The file { path } should parse into a Python dictionary (`dict`) "
3434 f"but it converts to the type `{ type (properties )} `. Is the file "
3535 "missing a curly bracket `{` at the beginning or `}` at the end?"
3636 ) from None # To hide the original traceback
3737
38- return properties
38+ # Can't determine type at end from the above input and processing,
39+ # so ignore the pyright/pylance warning.
40+ return properties # pyright: ignore[reportUnknownVariableType]
You can’t perform that action at this time.
0 commit comments