From 575adfc3071ad4e1239ed4ff4822529458a86ec5 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 22 Oct 2011 10:26:10 +0200 Subject: [PATCH] Do not crash if writing histfile fails with --hint-tester It does not affect the result and only means the user does not have any readline-history. --- britney.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index 049a137..83991ea 100755 --- a/britney.py +++ b/britney.py @@ -2475,8 +2475,10 @@ class Britney: self.printuninstchange() except KeyboardInterrupt: continue - - readline.write_history_file(histfile) + try: + readline.write_history_file(histfile) + except IOError, e: + self.__log("Could not write %s: %s" % (histfile, e), type="W") def do_hint(self, type, who, pkgvers): """Process hints