Python question: is there a concise way to write a...
# development
h
Python question: is there a concise way to write a
with
block where the presence/absence of the
with
is controllable via a flag?
basically is there a more concise way to write:
Copy code
def run(self, request: InteractiveProcess) -> InteractiveProcessResult:
        if request.capture_signals:
            with ExceptionSink.ignoring_sigint():
                return self._scheduler.run_local_interactive_process(request)
        else:
            return self._scheduler.run_local_interactive_process(request)
h
👍 1
w
there is an empty context manager
but that looks fine too