Skip to content

Commit

Permalink
Make a minor denormalization to gtkexcepthook.py to please MyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Sokolow authored and Stephan Sokolow committed Aug 23, 2017
1 parent 2318788 commit a40f4b7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions quicktile/gtkexcepthook.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def readline(lno=[lineno], *args):

class ExceptionHandler(object):
"""GTK-based graphical exception handler"""
cached_tback = None
cached_tb = None

def __init__(self, feedback_email=None, smtp_server=None):
# type: (str, str) -> None
Expand Down Expand Up @@ -246,14 +246,14 @@ def __call__(self, exctyp, value, tback):
while True:
resp = dialog.run()

# Generate and cache a traceback on demand
if resp in (2, 3) and self.cached_tback is None:
self.cached_tback = analyse(exctyp, value, tback).getvalue()

if resp == 3:
self.send_report(self.cached_tback)
if self.cached_tb is None:
self.cached_tb = analyse(exctyp, value, tback).getvalue()
self.send_report(self.cached_tb)
elif resp == 2:
details = self.make_details_dialog(dialog, self.cached_tback)
if self.cached_tb is None:
self.cached_tb = analyse(exctyp, value, tback).getvalue()
details = self.make_details_dialog(dialog, self.cached_tb)
details.run()
details.destroy()
elif resp == 1 and gtk.main_level() > 0:
Expand Down

0 comments on commit a40f4b7

Please sign in to comment.