[fix] minor type hint issues (#5459)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2025-11-20 18:35:43 +01:00
committed by GitHub
parent 21a4622f23
commit b299386d3e
3 changed files with 7 additions and 7 deletions

View File

@@ -741,7 +741,7 @@ def detect_language(text: str, threshold: float = 0.3, only_search_languages: bo
return None
def js_variable_to_python(js_variable: str) -> str:
def js_variable_to_python(js_variable: str) -> t.Any:
"""Convert a javascript variable into JSON and then load the value
It does not deal with all cases, but it is good enough for now.
@@ -808,7 +808,7 @@ def js_variable_to_python(js_variable: str) -> str:
# replace the surogate character by colon
s = s.replace(chr(1), ':')
# load the JSON and return the result
return json.loads(s) # pyright: ignore[reportAny]
return json.loads(s)
def parse_duration_string(duration_str: str) -> timedelta | None: