catch more invalid zip file errors

This commit is contained in:
Soren I. Bjornstad 2014-09-27 10:19:43 -05:00
parent a430803774
commit 9ec91724bf

View file

@ -313,8 +313,8 @@ backup, please see the 'Backups' section of the user manual."""))
else:
# if it's an apkg/zip, first test it's a valid file
if importer.__class__.__name__ == "AnkiPackageImporter":
z = zipfile.ZipFile(importer.file)
try:
z = zipfile.ZipFile(importer.file)
z.getinfo("collection.anki2")
except:
showWarning(invalidZipMsg())