@@ -124,9 +124,15 @@ def main(
124124        install_types (formatter , options , non_interactive = options .non_interactive )
125125        return 
126126
127-     use_color  =  (True  if  util .should_force_color ()
128-                  else  formatter .default_colored  if  options .color_output  ==  "auto" 
129-                  else  bool (options .color_output ))
127+     use_color  =  (
128+         True 
129+         if  util .should_force_color ()
130+         else  (
131+             formatter .default_colored 
132+             if  options .color_output  ==  "auto" 
133+             else  bool (options .color_output )
134+         )
135+     )
130136
131137    res , messages , blockers  =  run_build (sources , options , fscache , t0 , stdout , stderr , use_color )
132138
@@ -137,7 +143,9 @@ def main(
137143            install_types (formatter , options , after_run = True , non_interactive = True )
138144            fscache .flush ()
139145            print ()
140-             res , messages , blockers  =  run_build (sources , options , fscache , t0 , stdout , stderr , use_color )
146+             res , messages , blockers  =  run_build (
147+                 sources , options , fscache , t0 , stdout , stderr , use_color 
148+             )
141149        show_messages (messages , stderr , formatter , options , use_color )
142150
143151    if  MEM_PROFILE :
@@ -243,8 +251,11 @@ def flush_errors(filename: str | None, new_messages: list[str], serious: bool) -
243251
244252
245253def  show_messages (
246-     messages : list [str ], f : TextIO , formatter : util .FancyFormatter , options : Options ,
247-     use_color : bool 
254+     messages : list [str ],
255+     f : TextIO ,
256+     formatter : util .FancyFormatter ,
257+     options : Options ,
258+     use_color : bool ,
248259) ->  None :
249260    for  msg  in  messages :
250261        if  use_color :
@@ -467,10 +478,16 @@ def __call__(
467478        parser ._print_message (formatter .format_help (), self .stdout )
468479        parser .exit ()
469480
481+ 
470482# Coupled with the usage in define_options 
471483class  ColorOutputAction (argparse .Action ):
472-     def  __call__ (self , parser : argparse .ArgumentParser , namespace : argparse .Namespace ,
473-                  values : str  |  Sequence [Any ] |  None , option_string : str  |  None  =  None ) ->  None :
484+     def  __call__ (
485+         self ,
486+         parser : argparse .ArgumentParser ,
487+         namespace : argparse .Namespace ,
488+         values : str  |  Sequence [Any ] |  None ,
489+         option_string : str  |  None  =  None ,
490+     ) ->  None :
474491        assert  values  in  ("auto" , None )
475492        print (f"{ values = }  " )
476493        setattr (namespace , self .dest , True  if  values  is  None  else  "auto" )
@@ -1016,16 +1033,13 @@ def add_invertible_flag(
10161033        nargs = "?" ,
10171034        choices = ["auto" ],
10181035        help = "Colorize error messages (inverse: --no-color-output). " 
1019-               "Detects if to use color when option is omitted and --no-color-output " 
1020-               "is not given, or when --color-output=auto" ,
1036+         "Detects if to use color when option is omitted and --no-color-output " 
1037+         "is not given, or when --color-output=auto" ,
10211038    )
10221039    error_group .add_argument (
1023-         "--no-color-output" ,
1024-         dest = "color_output" ,
1025-         action = "store_false" ,
1026-         help = argparse .SUPPRESS ,
1040+         "--no-color-output" , dest = "color_output" , action = "store_false" , help = argparse .SUPPRESS 
10271041    )
1028-     #error_group.set_defaults(color_output="auto") 
1042+     #  error_group.set_defaults(color_output="auto") 
10291043    add_invertible_flag (
10301044        "--no-error-summary" ,
10311045        dest = "error_summary" ,
0 commit comments