util: Remove redundant cast in run_curl_into
The cast to 'T' in run_curl_into was redundant: mypy already narrows the return value of json.loads() to type T after the isinstance(ret, expected_type) check (where expected_type: type[T]). Remove the unnecessary cast and clean up the unused 'cast' import. This satisfies the new warn_redundant_casts mypy rule. Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f689d083d7
commit
044d2cb065
1 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,7 @@ import os
|
|||
import sys
|
||||
|
||||
from enum import Enum, auto
|
||||
from typing import TYPE_CHECKING, Iterable, TypeVar, cast
|
||||
from typing import TYPE_CHECKING, Iterable, TypeVar
|
||||
|
||||
from .base import Input, InputMode, Result
|
||||
from .log import DEBUG, ERR, log
|
||||
|
|
@ -93,7 +93,7 @@ async def run_curl_into(
|
|||
raise TypeError(
|
||||
f'Expected {expected_type.__name__}, got {type(ret).__name__} from Curl'
|
||||
)
|
||||
return cast('T', ret)
|
||||
return ret
|
||||
|
||||
async def run_askpass(
|
||||
askpass_env: list[str],
|
||||
|
|
|
|||
Loading…
Reference in a new issue