From 9803c90341fd741893dd14081834cbfdcce4dceb Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 22 Nov 2021 12:54:02 +0100 Subject: [PATCH] make it possible to disable exit on `SIGUSR1` --- mitmproxy/utils/debug.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mitmproxy/utils/debug.py b/mitmproxy/utils/debug.py index 986372efa..58e1848a2 100644 --- a/mitmproxy/utils/debug.py +++ b/mitmproxy/utils/debug.py @@ -99,7 +99,7 @@ def dump_info(signal=None, frame=None, file=sys.stdout, testing=False): # pragm print("****************************************************") - if not testing: + if not testing and not os.getenv("MITMPROXY_DEBUG_STAY_ALIVE"): # pragma: no cover sys.exit(1) @@ -117,7 +117,7 @@ def dump_stacks(signal=None, frame=None, file=sys.stdout, testing=False): if line: code.append(" %s" % (line.strip())) print("\n".join(code), file=file) - if not testing: # pragma: no cover + if not testing and not os.getenv("MITMPROXY_DEBUG_STAY_ALIVE"): # pragma: no cover sys.exit(1)