def run():
"""Execute main loop."""
try:
setup()
try:
parser, args = make_argparser()
mainloop(parser, args)
except KeyboardInterrupt as exc:
sys.stderr.flush()
sys.exit(2)
except IOError as exc:
if exc.errno == errno.EPIPE: # downstream is done with our output
sys.stderr.flush()
sys.exit(0)
else:
raise
finally:
logging.shutdown()
评论列表
文章目录