Fix up some changes made by 2to3
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import unittest
|
||||
import tempfile
|
||||
import os
|
||||
from mock import MagicMock
|
||||
from unittest.mock import MagicMock
|
||||
import shutil
|
||||
|
||||
import anki
|
||||
@@ -31,7 +31,7 @@ class CollectionTestBase(unittest.TestCase):
|
||||
model = self.collection.models.byName(data['model'])
|
||||
|
||||
note = Note(self.collection, model)
|
||||
for name, value in list(data['fields'].items()):
|
||||
for name, value in data['fields'].items():
|
||||
note[name] = value
|
||||
|
||||
if 'tags' in data:
|
||||
|
||||
@@ -69,11 +69,8 @@ def monkeypatch_db():
|
||||
|
||||
def patched___init__(self, path, text=None, timeout=0):
|
||||
# Code taken from Anki's DB.__init__()
|
||||
encpath = path
|
||||
if isinstance(encpath, str):
|
||||
encpath = path.encode("utf-8")
|
||||
# Allow more than one thread to use this connection.
|
||||
self._db = sqlite.connect(encpath,
|
||||
self._db = sqlite.connect(path,
|
||||
timeout=timeout,
|
||||
check_same_thread=False)
|
||||
if text:
|
||||
|
||||
@@ -22,7 +22,7 @@ def create_server_paths():
|
||||
}
|
||||
|
||||
def create_sync_app(server_paths, config_path):
|
||||
config = configparser.SafeConfigParser()
|
||||
config = configparser.ConfigParser()
|
||||
config.read(config_path)
|
||||
|
||||
# Use custom files and dirs in settings.
|
||||
|
||||
Reference in New Issue
Block a user