| 
11 | 11 | from collections.abc import Sequence  | 
12 | 12 | from gettext import gettext  | 
13 | 13 | from io import TextIOWrapper  | 
14 |  | -from typing import IO, TYPE_CHECKING, Any, Final, Literal, NoReturn, TextIO, Union, cast  | 
 | 14 | +from typing import IO, TYPE_CHECKING, Any, Final, Literal, NoReturn, TextIO, cast  | 
15 | 15 | 
 
  | 
16 | 16 | from mypy import build, defaults, state, util  | 
17 | 17 | from mypy.config_parser import (  | 
@@ -94,15 +94,15 @@ def main(  | 
94 | 94 |     use_color: bool | Literal["auto"] = (  | 
95 | 95 |         True  | 
96 | 96 |         if util.should_force_color()  | 
97 |  | -        else (  | 
98 |  | -            "auto"  | 
99 |  | -            if options.color_output == "auto"  | 
100 |  | -            else cast(bool, options.color_output)  | 
101 |  | -        )  | 
 | 97 | +        else ("auto" if options.color_output == "auto" else cast(bool, options.color_output))  | 
102 | 98 |     )  | 
103 | 99 | 
 
  | 
104 | 100 |     formatter = util.FancyFormatter(  | 
105 |  | -        stdout, stderr, options.hide_error_codes, hide_success=bool(options.output), color_request=use_color  | 
 | 101 | +        stdout,  | 
 | 102 | +        stderr,  | 
 | 103 | +        options.hide_error_codes,  | 
 | 104 | +        hide_success=bool(options.output),  | 
 | 105 | +        color_request=use_color,  | 
106 | 106 |     )  | 
107 | 107 | 
 
  | 
108 | 108 |     if options.allow_redefinition_new and not options.local_partial_types:  | 
@@ -198,8 +198,11 @@ def run_build(  | 
198 | 198 |     use_color: bool | Literal["auto"],  | 
199 | 199 | ) -> tuple[build.BuildResult | None, list[str], bool]:  | 
200 | 200 |     formatter = util.FancyFormatter(  | 
201 |  | -        stdout, stderr, options.hide_error_codes, hide_success=bool(options.output),  | 
202 |  | -        color_request=use_color  | 
 | 201 | +        stdout,  | 
 | 202 | +        stderr,  | 
 | 203 | +        options.hide_error_codes,  | 
 | 204 | +        hide_success=bool(options.output),  | 
 | 205 | +        color_request=use_color,  | 
203 | 206 |     )  | 
204 | 207 | 
 
  | 
205 | 208 |     messages = []  | 
 | 
0 commit comments