mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[fix] minor type hint issues (#5459)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user