chore: Fix strict pyright analysis errors

This commit is contained in:
Marty Oehme 2024-06-14 15:13:24 +02:00
parent 8093259551
commit 6b35b2f918
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
4 changed files with 30 additions and 16 deletions

View file

@ -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)