# HG changeset patch # User Thomas Arendsen Hein # Date 1250607557 -7200 # Node ID a06e068e3de85f018eefd263fce1f8a3b1b8293c # Parent 28489e672e610c73446c1b734d6a3f8d9e9fac9f Handle empty input when adding/subtracting time of the running project diff -r 28489e672e61 -r a06e068e3de8 getan --- a/getan Tue Aug 18 16:55:51 2009 +0200 +++ b/getan Tue Aug 18 16:59:17 2009 +0200 @@ -663,7 +663,7 @@ seconds = timedelta(seconds=seconds) self.current_project.start_time -= seconds stdscr.addstr(ofs + 1, 3, "added %s" % human_time(seconds)) - except ValueError: + except (ValueError, IndexError): pass stdscr.refresh() signal.signal(signal.SIGALRM, alarm_handler) @@ -699,7 +699,7 @@ self.current_project.subtractTime(cur, seconds) finally: tolerantClose(cur) - except ValueError: + except (ValueError, IndexError): pass stdscr.refresh() signal.signal(signal.SIGALRM, alarm_handler)