]> git.ipfire.org Git - oddments/ddns.git/commitdiff
database: Remove some unused code to close the database
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 15 Jan 2020 16:41:43 +0000 (17:41 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 15 Jan 2020 16:41:43 +0000 (17:41 +0100)
The interfaces have changed in Python 3 and we do not
explicitely need to close the database connection.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/ddns/database.py

index e0a035ab83087f56d7e56beba3b9c36d7fe42c80..2de050b1b7f590e3c570365b9f0702054a61d0d6 100644 (file)
@@ -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)