No need for self.cur, just cur.

master
voussoir 2017-11-16 18:03:51 -08:00
parent 259c9ee1ab
commit 64d8410977
1 changed files with 4 additions and 4 deletions

View File

@ -1124,17 +1124,17 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs
existing_database = self.database_file.exists existing_database = self.database_file.exists
self.sql = sqlite3.connect(self.database_file.absolute_path) self.sql = sqlite3.connect(self.database_file.absolute_path)
self.cur = self.sql.cursor() cur = self.sql.cursor()
if existing_database: if existing_database:
self.cur.execute('PRAGMA user_version') cur.execute('PRAGMA user_version')
existing_version = self.cur.fetchone()[0] existing_version = cur.fetchone()[0]
if existing_version != DATABASE_VERSION: if existing_version != DATABASE_VERSION:
raise exceptions.DatabaseOutOfDate(current=existing_version, new=DATABASE_VERSION) raise exceptions.DatabaseOutOfDate(current=existing_version, new=DATABASE_VERSION)
statements = DB_INIT.split(';') statements = DB_INIT.split(';')
for statement in statements: for statement in statements:
self.cur.execute(statement) cur.execute(statement)
self.sql.commit() self.sql.commit()
# CONFIG # CONFIG