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:
Jan Lindemann 2026-07-22 21:12:06 +02:00
commit 044d2cb065
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -5,7 +5,7 @@ import os
import sys import sys
from enum import Enum, auto 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 .base import Input, InputMode, Result
from .log import DEBUG, ERR, log from .log import DEBUG, ERR, log
@ -93,7 +93,7 @@ async def run_curl_into(
raise TypeError( raise TypeError(
f'Expected {expected_type.__name__}, got {type(ret).__name__} from Curl' f'Expected {expected_type.__name__}, got {type(ret).__name__} from Curl'
) )
return cast('T', ret) return ret
async def run_askpass( async def run_askpass(
askpass_env: list[str], askpass_env: list[str],