[pre-commit.ci] pre-commit autoupdate (#4547)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.1)

* Fix wrapper's return types to be String or Text IO

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Cooper Ry Lees <me@cooperlees.com>
This commit is contained in:
pre-commit-ci[bot] 2025-01-07 11:42:27 -08:00 committed by GitHub
parent e157ba4de5
commit 40b73f2fb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -39,7 +39,7 @@ repos:
exclude: ^src/blib2to3/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
exclude: ^(docs/conf.py|scripts/generate_schema.py)$

View File

@ -1355,8 +1355,10 @@ def test_reformat_one_with_stdin_empty(self) -> None:
def _new_wrapper(
output: io.StringIO, io_TextIOWrapper: type[io.TextIOWrapper]
) -> Callable[[Any, Any], io.TextIOWrapper]:
def get_output(*args: Any, **kwargs: Any) -> io.TextIOWrapper:
) -> Callable[[Any, Any], Union[io.StringIO, io.TextIOWrapper]]:
def get_output(
*args: Any, **kwargs: Any
) -> Union[io.StringIO, io.TextIOWrapper]:
if args == (sys.stdout.buffer,):
# It's `format_stdin_to_stdout()` calling `io.TextIOWrapper()`,
# return our mock object.