##// END OF EJS Templates
Merge pull request #8311 from thedrow/topic/fix-history-crash...
Matthias Bussonnier -
r21260:d56cbbe7 merge
parent child Browse files
Show More
@@ -70,11 +70,16 b' def needs_sqlite(f, self, *a, **kw):'
70 70
71 71 if sqlite3 is not None:
72 72 DatabaseError = sqlite3.DatabaseError
73 OperationalError = sqlite3.OperationalError
73 74 else:
74 75 @undoc
75 76 class DatabaseError(Exception):
76 77 "Dummy exception when sqlite could not be imported. Should never occur."
77 78
79 @undoc
80 class OperationalError(Exception):
81 "Dummy exception when sqlite could not be imported. Should never occur."
82
78 83 @decorator
79 84 def catch_corrupt_db(f, self, *a, **kw):
80 85 """A decorator which wraps HistoryAccessor method calls to catch errors from
@@ -83,7 +88,7 b' def catch_corrupt_db(f, self, *a, **kw):'
83 88 """
84 89 try:
85 90 return f(self, *a, **kw)
86 except DatabaseError:
91 except (DatabaseError, OperationalError):
87 92 if os.path.isfile(self.hist_file):
88 93 # Try to move the file out of the way
89 94 base,ext = os.path.splitext(self.hist_file)
General Comments 0
You need to be logged in to leave comments. Login now