diff --git a/iotop/ui.py b/iotop/ui.py index e033c92..9bdab7a 100644 --- a/iotop/ui.py +++ b/iotop/ui.py @@ -520,6 +520,17 @@ Please do not file bugs on iotop about this.''', file=sys.stderr) sys.exit(1) else: raise + except curses.error as e: + stre = str(e) + if stre.find('ERR')>=0 and ( + stre.find('nocbreak()')>=0 or stre.find('endwin()')>=0 + ): + pass + # endwin and nocbreak can cause error (and raise hard to catch + # exception) if iotop was running in the terminal and that + # terminal got closed while iotop was still running + else: + raise # # Profiling