diff --git a/qt/aqt/importing.py b/qt/aqt/importing.py index ce217287a..257fd4bfe 100644 --- a/qt/aqt/importing.py +++ b/qt/aqt/importing.py @@ -10,6 +10,7 @@ import traceback import unicodedata import zipfile from concurrent.futures import Future +from typing import Optional import anki.importing as importing import aqt.deckchooser @@ -55,7 +56,7 @@ class ChangeMap(QDialog): self.frm.fields.setCurrentRow(n) else: self.frm.fields.setCurrentRow(n + 1) - self.field = None + self.field: Optional[str] = None def getField(self): self.exec_() @@ -488,7 +489,9 @@ def _replaceWithApkg(mw, filename, backup): colname = "collection.anki2" with z.open(colname) as source, open(mw.pm.collectionPath(), "wb") as target: - shutil.copyfileobj(source, target) + # ignore appears related to https://github.com/python/typeshed/issues/4349 + # see if can turn off once issue fix is merged in + shutil.copyfileobj(source, target) # type: ignore d = os.path.join(mw.pm.profileFolder(), "collection.media") for n, (cStr, file) in enumerate( diff --git a/qt/mypy.ini b/qt/mypy.ini index b6203b753..44468f7aa 100644 --- a/qt/mypy.ini +++ b/qt/mypy.ini @@ -72,3 +72,5 @@ check_untyped_defs=true check_untyped_defs=true [mypy-aqt.errors] check_untyped_defs=true +[mypy-aqt.importing] +check_untyped_defs=true