remove db.close()

This commit is contained in:
Damien Elmes 2020-03-06 14:06:33 +10:00
parent fa12213e98
commit 7986a79530
3 changed files with 1 additions and 8 deletions

View file

@ -256,7 +256,6 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
self.save(trx=False) self.save(trx=False)
if not self.server: if not self.server:
self.db.execute("pragma journal_mode = delete") self.db.execute("pragma journal_mode = delete")
self.db.close()
self.db = None self.db = None
self.backend = None self.backend = None
self.media.close() self.media.close()

View file

@ -7,8 +7,6 @@ from typing import Any, Iterable, List, Optional, Sequence, Union
import anki import anki
# fixme: col.close()/col.reopen() & journal_mode=delete
# DBValue is actually Union[str, int, float, None], but if defined # DBValue is actually Union[str, int, float, None], but if defined
# that way, every call site needs to do a type check prior to using # that way, every call site needs to do a type check prior to using
# the return values. # the return values.
@ -27,10 +25,6 @@ class DBProxy:
self._path = path self._path = path
self.mod = False self.mod = False
def close(self) -> None:
# fixme
pass
# Transactions # Transactions
############### ###############

View file

@ -22,7 +22,7 @@ def getEmptyCol():
os.close(fd) os.close(fd)
os.unlink(nam) os.unlink(nam)
col = aopen(nam) col = aopen(nam)
col.db.close() col.close()
getEmptyCol.master = nam getEmptyCol.master = nam
(fd, nam) = tempfile.mkstemp(suffix=".anki2") (fd, nam) = tempfile.mkstemp(suffix=".anki2")
shutil.copy(getEmptyCol.master, nam) shutil.copy(getEmptyCol.master, nam)