Fix another FileNotFoundError in license check

This commit is contained in:
Raphael Michel
2021-04-26 13:07:09 +02:00
parent 2cd67d6036
commit 8921ccb8c1

View File

@@ -172,6 +172,7 @@ class LicenseCheckView(StaffMemberRequiredMixin, FormView):
pkg = pkgs[0] pkg = pkgs[0]
except: except:
return None, None return None, None
try:
for line in pkg.get_metadata_lines('PKG-INFO'): for line in pkg.get_metadata_lines('PKG-INFO'):
if ': ' in line: if ': ' in line:
(k, v) = line.split(': ', 1) (k, v) = line.split(': ', 1)
@@ -179,6 +180,9 @@ class LicenseCheckView(StaffMemberRequiredMixin, FormView):
license = v license = v
if k == "Home-page": if k == "Home-page":
url = v url = v
except FileNotFoundError:
license = '?'
url = '?'
return license, url return license, url
def _check_results(self, input): def _check_results(self, input):