fix package type detector

This commit is contained in:
Shahrustam
2020-05-28 12:49:32 +03:00
parent 8e72c48319
commit 25a421402b

View File

@ -45,12 +45,12 @@ class PackageType(object):
manifest_map = cls.get_manifest_map() manifest_map = cls.get_manifest_map()
with tarfile.open(path, mode="r|gz") as tf: with tarfile.open(path, mode="r|gz") as tf:
for t in sorted(cls.items().values()): for t in sorted(cls.items().values()):
try: for manifest in manifest_map[t]:
for manifest in manifest_map[t]: try:
if tf.getmember(manifest): if tf.getmember(manifest):
return t return t
except KeyError: except KeyError:
pass pass
return None return None