Пример #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)
Пример #3
0
def main():
    exiter = Exiter()
    exiter.set_except_hook()

    try:
        PantsRunner(exiter).run()
    except KeyboardInterrupt:
        exiter.exit_and_fail(b'Interrupted by user.')
Пример #4
0
def main():
    start_time = time.time()

    with maybe_profiled(os.environ.get('PANTSC_PROFILE')):
        try:
            PantsRunner(start_time=start_time).run()
        except KeyboardInterrupt as e:
            ExceptionSink.get_global_exiter().exit_and_fail(
                'Interrupted by user:\n{}'.format(e))
Пример #5
0
def main():
    exiter = Exiter()
    exiter.set_except_hook()

    with maybe_profiled(os.environ.get('PANTSC_PROFILE')):
        try:
            PantsRunner(exiter).run()
        except KeyboardInterrupt:
            exiter.exit_and_fail(b'Interrupted by user.')
Пример #6
0
def main():
    start_time = time.time()

    exiter = Exiter()
    ExceptionSink.reset_exiter(exiter)

    with maybe_profiled(os.environ.get('PANTSC_PROFILE')):
        try:
            PantsRunner(exiter, start_time=start_time).run()
        except KeyboardInterrupt:
            exiter.exit_and_fail('Interrupted by user.')