From 94833aa63afcbf453b926640ed8a23ccd0eed51d Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 7 Oct 2014 23:14:29 -0700 Subject: [PATCH] Change thread option on SQLite opens --- pyircbot/modules/SQLite.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyircbot/modules/SQLite.py b/pyircbot/modules/SQLite.py index 9ee5c13..3e4252b 100644 --- a/pyircbot/modules/SQLite.py +++ b/pyircbot/modules/SQLite.py @@ -75,7 +75,7 @@ class Connection: # Connects to the database server, and selects a database (Or attempts to create it if it doesn't exist yet) def _connect(self): self.log.info("Sqlite: opening database %s" % self.master.getFilePath(self.dbname)) - self.connection = sqlite3.connect(self.master.getFilePath(self.dbname)) + self.connection = sqlite3.connect(self.master.getFilePath(self.dbname), check_same_thread=False) self.connection.row_factory = Connection.dict_factory self.connection.isolation_level = None self.log.info("Sqlite: Connected.") @@ -84,3 +84,6 @@ class Connection: c = self.connection.cursor() derp=c.execute("SELECT * FROM SQLITE_MASTER") c.close() + + def close(self): + self.connection.close()