From 9bcdce1c8005f140cdaacaa7bf74dc3756fc442d Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 15 Jan 2020 17:41:43 +0100 Subject: [PATCH] database: Remove some unused code to close the database The interfaces have changed in Python 3 and we do not explicitely need to close the database connection. Signed-off-by: Stefan Schantl --- src/ddns/database.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/ddns/database.py b/src/ddns/database.py index e0a035a..2de050b 100644 --- a/src/ddns/database.py +++ b/src/ddns/database.py @@ -37,9 +37,6 @@ class DDNSDatabase(object): # so that we do not do it unnecessarily. self._db = None - def __del__(self): - self._close_database() - def _open_database(self, path): logger.debug("Opening database %s" % path) @@ -80,12 +77,6 @@ class DDNSDatabase(object): # In that case the database file will be created in _open_database(). return os.access(os.path.dirname(self.path), os.W_OK) - def _close_database(self): - if self._db: - # TODO: Check Unresolved attribute reference '_db_close' for class 'DDNSDatabase' - self._db_close() - self._db = None - def _execute(self, query, *parameters): if self._db is None: self._db = self._open_database(self.path) -- 2.39.5