disable u2idx if sqlite3 is unavailable

This commit is contained in:
ed 2021-06-21 20:22:54 +02:00
parent 35e2138e3e
commit 6dd39811d4

View file

@ -26,7 +26,7 @@ class U2idx(object):
self.timeout = self.args.srch_time self.timeout = self.args.srch_time
if not HAVE_SQLITE3: if not HAVE_SQLITE3:
self.log("could not load sqlite3; searchign wqill be disabled") self.log("your python does not have sqlite3; searching will be disabled")
return return
self.cur = {} self.cur = {}
@ -57,6 +57,9 @@ class U2idx(object):
raise Pebkac(500, min_ex()) raise Pebkac(500, min_ex())
def get_cur(self, ptop): def get_cur(self, ptop):
if not HAVE_SQLITE3:
return None
cur = self.cur.get(ptop) cur = self.cur.get(ptop)
if cur: if cur:
return cur return cur