Markov: clean up the whole "need to create our own db object" thing

This commit is contained in:
Brian S. Stephan 2011-05-01 10:41:59 -05:00
parent 03d0d6bc2d
commit 5e8e93beba
1 changed files with 2 additions and 3 deletions

View File

@ -411,9 +411,8 @@ class Markov(Module):
try:
# need to create our own db object, since this is likely going to be in a new thread
dbfile = self.config.get('dr.botzo', 'database')
conn = sqlite3.connect(dbfile)
conn.row_factory = sqlite3.Row
db = conn
db = sqlite3.connect(dbfile)
db.row_factory = sqlite3.Row
query = 'SELECT target FROM markov_chatter_target'
cursor = db.execute(query)
results = cursor.fetchall()