From 418345c1f81d103e5ec091be0e211d8d4978c3c0 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 27 Oct 2020 01:08:24 +0100 Subject: [PATCH] fixing null registry checks --- src/registry.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/registry.py b/src/registry.py index 3d8cfd3..4eff031 100644 --- a/src/registry.py +++ b/src/registry.py @@ -15,27 +15,27 @@ class Registry: self._conn = sqlite3.connect(db_file, check_same_thread=False) def is_registered(self, name): - if not db_file: return False + if not self._conn: return False c = self._conn.cursor() c.execute("SELECT COUNT(*) FROM cache WHERE name=?", (name,)) return c.fetchone() != None def clean(self): - if not db_file: return + if not self._conn: return c = self._conn.cursor() c.execute("DELETE FROM cache WHERE access_time