mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 23:09:44 +00:00
Catch and ignore thread errors on exit
Keyboard interrupts bugger up Queues in some way, which causes a traceback on exit in many of our tools. The issue seems easiest to reproduce with binary builds on OSX.
This commit is contained in:
parent
de5df2e4d4
commit
6135e16482
@ -2,6 +2,7 @@ from __future__ import print_function, absolute_import
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
import thread
|
||||
from netlib.version_check import check_pyopenssl_version, check_mitmproxy_version
|
||||
from . import version, cmdline
|
||||
from .exceptions import ServerException
|
||||
@ -62,7 +63,7 @@ def mitmproxy(args=None): # pragma: nocover
|
||||
m = console.ConsoleMaster(server, console_options)
|
||||
try:
|
||||
m.run()
|
||||
except KeyboardInterrupt:
|
||||
except (KeyboardInterrupt, thread.error):
|
||||
pass
|
||||
|
||||
|
||||
@ -97,7 +98,7 @@ def mitmdump(args=None): # pragma: nocover
|
||||
except dump.DumpError as e:
|
||||
print("mitmdump: %s" % e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt:
|
||||
except (KeyboardInterrupt, thread.error):
|
||||
pass
|
||||
|
||||
|
||||
@ -125,5 +126,5 @@ def mitmweb(args=None): # pragma: nocover
|
||||
m = web.WebMaster(server, web_options)
|
||||
try:
|
||||
m.run()
|
||||
except KeyboardInterrupt:
|
||||
except (KeyboardInterrupt, thread.error):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user