From 95b8d655e62d5723937c672a078c812a664c5911 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 18 Mar 2009 22:45:43 +0900 Subject: [PATCH] remove shared cache mode, it's not needed --- anki/db.py | 1 - anki/importing/anki10.py | 1 + tests/test_importing.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/db.py b/anki/db.py index a2e26a888..801c2465a 100644 --- a/anki/db.py +++ b/anki/db.py @@ -22,7 +22,6 @@ except ImportError: from sqlite3 import dbapi2 as sqlite except: raise "Please install pysqlite2 or python2.5" -sqlite.enable_shared_cache(True) from sqlalchemy import (Table, Integer, Float, Column, MetaData, ForeignKey, Boolean, String, Date, diff --git a/anki/importing/anki10.py b/anki/importing/anki10.py index 7f437369c..4bf1ae31e 100644 --- a/anki/importing/anki10.py +++ b/anki/importing/anki10.py @@ -74,6 +74,7 @@ class Anki10Importer(Importer): # update total and refresh self.total = len(res['added-facts']['facts']) src.s.rollback() + src.engine.dispose() self.deck.flushMod() self.deck.finishProgress() diff --git a/tests/test_importing.py b/tests/test_importing.py index dc817d206..002e127fc 100644 --- a/tests/test_importing.py +++ b/tests/test_importing.py @@ -59,6 +59,7 @@ def test_anki10(): i.doImport() assert i.total == 2 deck.s.rollback() + deck.close() # import a deck into itself - 10-2 is the same as test10, but with one # card answered and another deleted. nothing should be synced to client deck = DeckStorage.Deck(file)