Skip to content

Commit

Permalink
Refix bug #50, crash on multiple esc
Browse files Browse the repository at this point in the history
  • Loading branch information
amanusk committed Aug 27, 2018
1 parent 867e767 commit f0f0369
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion s_tui/HelperFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from collections import OrderedDict
from sys import exit

__version__ = "0.8.1"
__version__ = "0.8.2"


def get_processor_name():
Expand Down
8 changes: 7 additions & 1 deletion s_tui/s_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,15 +759,21 @@ def main(self):
try:
self.loop.run()
except (ZeroDivisionError) as e:
# In case of Zero division, we want an error to return, and
# get a clue where this happens
logging.debug("Some stat caused divide by zero exception. Exiting")
logging.error(e, exc_info=True)
print(ERROR_MESSAGE)
except (AttributeError) as e:
# In this case we restart the loop, to address bug #50, where
# urwid crashes on multiple presses on 'esc'
logging.debug("Catch attribute Error in urwid and restart")
logging.debug(e, exc_info=True)
self.main()
except (psutil.NoSuchProcess) as e:
logging.error("No such proccess error")
# This might happen if the stress process is not found, in this
# case, we want to know why
logging.error("No such process error")
logging.error(e, exc_info=True)
print(ERROR_MESSAGE)

Expand Down

0 comments on commit f0f0369

Please sign in to comment.