Quick hack to handle case of non-text, non-python files

This commit is contained in:
gandalf3
2017-07-02 18:39:58 -07:00
parent 9f0ff11421
commit 5ad139ac13
2 changed files with 6 additions and 3 deletions

View File

@@ -91,9 +91,12 @@ def extract_blinfo(item: Path) -> dict:
except zipfile.BadZipFile:
# If it's not a valid zip, assume file is just a normal file
# TODO: this probably blows up inelegantly on corrupted zips
with item.open() as f:
blinfo = parse_blinfo(f.read())
try:
with item.open() as f:
blinfo = parse_blinfo(f.read())
except: #HACK
# If it's not a zip and its not parse-able python, then it's not an addon
raise BadAddon("File '%s' doesn't appear to be an addon" % item)
# This should not happen
if blinfo == None: