示例#1
0
 def run_default_entrypoint() -> None:
     with maybe_profiled(os.environ.get(PANTSC_PROFILE)):
         start_time = time.time()
         try:
             runner = PantsRunner(args=sys.argv, env=os.environ)
             exit_code = runner.run(start_time)
         except KeyboardInterrupt as e:
             print(f"Interrupted by user:\n{e}", file=sys.stderr)
             exit_code = PANTS_FAILED_EXIT_CODE
     sys.exit(exit_code)
示例#2
0
def main():
    with maybe_profiled(os.environ.get("PANTSC_PROFILE")):
        start_time = time.time()
        try:
            runner = PantsRunner(args=sys.argv, env=os.environ)
            exit_code = runner.run(start_time)
        except KeyboardInterrupt as e:
            print("Interrupted by user:\n{}".format(e), file=sys.stderr)
            exit_code = PANTS_FAILED_EXIT_CODE
        except Exception as e:
            logger.exception(e)
            exit_code = PANTS_FAILED_EXIT_CODE
    sys.exit(exit_code)