def launch_repl(self, pex, **pex_run_kwargs): # While the repl subprocess is synchronously spawned, we rely on process group # signalling for a SIGINT to reach the repl subprocess directly - and want to # do nothing in response on the parent side. # # NB: We use ExceptionSink.ignoring_sigint instead of ExceptionSink.trapped_signals here # because this code may be running from a non-main thread when run under pantsd, and therefore # will crash if we try to install new signal handlers. with ExceptionSink.ignoring_sigint(): self._run_repl(pex, **pex_run_kwargs)
def run(self, request: InteractiveProcess) -> InteractiveProcessResult: if request.forward_signals_to_process: with ExceptionSink.ignoring_sigint(): return self._scheduler.run_local_interactive_process(request) return self._scheduler.run_local_interactive_process(request)