diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-11-01 10:09:36 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-01 10:09:36 +1300 |
commit | 2c85b262d5036db08a1c1b8df50d84f8ed6410da (patch) | |
tree | a3090caccfdaa1396a5becb9909eac737e69bf2e | |
parent | 0aed002ad8a763e4a8bfb44ac4d08d6a791fa91c (diff) | |
parent | ecffaab8627ab2cdb05f52a3dc199fb9b171251e (diff) | |
download | mitmproxy-2c85b262d5036db08a1c1b8df50d84f8ed6410da.tar.gz mitmproxy-2c85b262d5036db08a1c1b8df50d84f8ed6410da.tar.bz2 mitmproxy-2c85b262d5036db08a1c1b8df50d84f8ed6410da.zip |
Merge pull request #1695 from cortesi/term
console: Minor cleanups
-rw-r--r-- | mitmproxy/tools/console/master.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/mitmproxy/tools/console/master.py b/mitmproxy/tools/console/master.py index 4c5e8c8c..3db6f425 100644 --- a/mitmproxy/tools/console/master.py +++ b/mitmproxy/tools/console/master.py @@ -3,7 +3,6 @@ import mimetypes import os import os.path import shlex -import signal import stat import subprocess import sys @@ -256,7 +255,6 @@ class ConsoleMaster(master.Master): changed = self.tick(timeout=0) if changed: self.loop.draw_screen() - signals.update_settings.send() self.loop.set_alarm_in(0.01, self.ticker) def run(self): @@ -293,13 +291,6 @@ class ConsoleMaster(master.Master): ) self.loop.set_alarm_in(0.01, http2err) - # It's not clear why we need to handle this explicitly - without this, - # mitmproxy hangs on keyboard interrupt. Remove if we ever figure it - # out. - def exit(s, f): - raise urwid.ExitMainLoop - signal.signal(signal.SIGINT, exit) - self.loop.set_alarm_in( 0.0001, lambda *args: self.view_flowlist() @@ -316,8 +307,9 @@ class ConsoleMaster(master.Master): print("Please lodge a bug report at:", file=sys.stderr) print("\thttps://github.com/mitmproxy/mitmproxy", file=sys.stderr) print("Shutting down...", file=sys.stderr) - sys.stderr.flush() - self.shutdown() + finally: + sys.stderr.flush() + self.shutdown() def view_help(self, helpctx): signals.push_view_state.send( |