Close whole collection instead of just the database

This commit is contained in:
Karsten Lehmann 2020-08-28 20:09:59 +02:00
parent 60f12cf0a0
commit 9831159653
No known key found for this signature in database
GPG Key ID: 6C34E8199743C270

View File

@ -5,7 +5,6 @@ import tempfile
from anki import Collection from anki import Collection
class CollectionUtils: class CollectionUtils:
""" """
Provides utility methods for creating, inspecting and manipulating anki Provides utility methods for creating, inspecting and manipulating anki
@ -26,7 +25,7 @@ class CollectionUtils:
file_path = os.path.join(self.tempdir, "collection.anki2") file_path = os.path.join(self.tempdir, "collection.anki2")
master_col = Collection(file_path) master_col = Collection(file_path)
master_col.db.close() master_col.close()
self.master_db_path = file_path self.master_db_path = file_path
def __enter__(self): def __enter__(self):