chore: Fix strict pyright analysis errors
This commit is contained in:
parent
8093259551
commit
6b35b2f918
4 changed files with 30 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import math
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Optional, cast
|
||||
|
||||
import chevron
|
||||
import papis.config
|
||||
|
|
@ -127,7 +127,7 @@ class Annotation:
|
|||
"""
|
||||
rawvalue: Any = papis.config.general_get(key, section=section)
|
||||
if isinstance(rawvalue, dict):
|
||||
return rawvalue
|
||||
return cast(dict[str, str], rawvalue)
|
||||
try:
|
||||
rawvalue = eval(rawvalue)
|
||||
except Exception:
|
||||
|
|
@ -142,4 +142,4 @@ class Annotation:
|
|||
)
|
||||
)
|
||||
|
||||
return rawvalue
|
||||
return cast(dict[str, str], rawvalue)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue