def main(): try: # auto completion if len(argv) >= 2 and argv[1] == "--auto_complete": possible_completions() sys.exit(0) # normal call process(argv[1:]) except (KeyboardInterrupt, PermissionError): sys.exit(1) except SystemExit as e: sys.exit(e) except: logging.error("", exc_info=True) sys.exit(1)
def main(): from locale import setlocale, LC_ALL setlocale(LC_ALL, '') # initialize locales because python doesn't try: # auto completion if len(argv) >= 2 and argv[1] == "--auto_complete": possible_completions() sys.exit(0) # normal call process(argv[1:]) except (KeyboardInterrupt, PermissionError): sys.exit(1) except SystemExit as e: sys.exit(e) except: logging.error("", exc_info=True) sys.exit(1)