Quick hack to handle case of non-text, non-python files
This commit is contained in:
@@ -91,9 +91,12 @@ def extract_blinfo(item: Path) -> dict:
|
|||||||
|
|
||||||
except zipfile.BadZipFile:
|
except zipfile.BadZipFile:
|
||||||
# If it's not a valid zip, assume file is just a normal file
|
# If it's not a valid zip, assume file is just a normal file
|
||||||
# TODO: this probably blows up inelegantly on corrupted zips
|
try:
|
||||||
with item.open() as f:
|
with item.open() as f:
|
||||||
blinfo = parse_blinfo(f.read())
|
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
|
# This should not happen
|
||||||
if blinfo == None:
|
if blinfo == None:
|
||||||
|
BIN
tests/test_helpers/addons/nonzip_nonaddon.tar
Normal file
BIN
tests/test_helpers/addons/nonzip_nonaddon.tar
Normal file
Binary file not shown.
Reference in New Issue
Block a user