avoid to close sys.stdout when no output file name given in the command line