From f9d9d0b67c4ed0b171471f9c6351b2e8c19dd2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 16 Jan 2025 18:59:07 +0100 Subject: [PATCH] fix: correct stdout type annotations --- translation_finder/api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/translation_finder/api.py b/translation_finder/api.py index 02c1a45..c91e72b 100644 --- a/translation_finder/api.py +++ b/translation_finder/api.py @@ -8,12 +8,11 @@ import sys from argparse import ArgumentParser -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING, TextIO from .finder import Finder, PathMockType if TYPE_CHECKING: - from io import TextIOWrapper from pathlib import PurePath from translation_finder.discovery.base import BaseDiscovery @@ -54,9 +53,9 @@ def discover( return results -def cli(stdout: TextIOWrapper | None = None, args: list[str] | None = None) -> int: +def cli(stdout: TextIO | None = None, args: list[str] | None = None) -> int: """Execution entry point.""" - stdout = stdout if stdout is not None else cast("TextIOWrapper", sys.stdout) + stdout = stdout if stdout is not None else sys.stdout parser = ArgumentParser( description="Weblate translation discovery utility.",