File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,19 +32,17 @@ def _main(args=None):
3232 if args .subcommand is None :
3333 argparser .print_help ()
3434 elif args .subcommand in SUBCOMMANDS :
35- return SUBCOMMANDS [args .subcommand ].main (args )
35+ # Since printing the output to stdout is important here,
36+ # we redirect all other stdout to stderr.
37+ with utils .RedirectStdout ():
38+ return SUBCOMMANDS [args .subcommand ].main (args )
3639 else :
3740 raise NotImplementedError
3841
3942
4043def main (args = None , do_print = True ):
41- """Run the command-line interface.
42-
43- Since printing the output to stdout is important here,
44- we redirect all other stdout to stderr.
45- """
46- with utils .RedirectStdout ():
47- output = _main (args )
44+ """Run the command-line interface."""
45+ output = _main (args )
4846 if do_print :
4947 utils .print_output (output )
5048 return 0
You can’t perform that action at this time.
0 commit comments