another fix for add-on downloading

This commit is contained in:
Damien Elmes 2016-08-02 11:51:44 +10:00
parent 6377dd161f
commit 54ea891564

View File

@ -1,7 +1,7 @@
# Copyright: Damien Elmes <anki@ichi2.net> # Copyright: Damien Elmes <anki@ichi2.net>
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import io
import sys, os, traceback import sys, os, traceback
from io import StringIO from io import StringIO
import zipfile import zipfile
@ -133,7 +133,7 @@ download add-ons that say they support Anki 2.1.x in the description.""")
return return
# .zip file # .zip file
try: try:
z = ZipFile(StringIO(data)) z = ZipFile(io.BytesIO(data))
except zipfile.BadZipfile: except zipfile.BadZipfile:
showWarning(_("The download was corrupt. Please try again.")) showWarning(_("The download was corrupt. Please try again."))
return return