From 8921ccb8c19594f03a9db3ecca52939c400b6d16 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 26 Apr 2021 13:07:09 +0200 Subject: [PATCH] Fix another FileNotFoundError in license check --- src/pretix/control/views/global_settings.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pretix/control/views/global_settings.py b/src/pretix/control/views/global_settings.py index edb76de425..9a9ef9e637 100644 --- a/src/pretix/control/views/global_settings.py +++ b/src/pretix/control/views/global_settings.py @@ -172,13 +172,17 @@ class LicenseCheckView(StaffMemberRequiredMixin, FormView): pkg = pkgs[0] except: return None, None - for line in pkg.get_metadata_lines('PKG-INFO'): - if ': ' in line: - (k, v) = line.split(': ', 1) - if k == "License": - license = v - if k == "Home-page": - url = v + try: + for line in pkg.get_metadata_lines('PKG-INFO'): + if ': ' in line: + (k, v) = line.split(': ', 1) + if k == "License": + license = v + if k == "Home-page": + url = v + except FileNotFoundError: + license = '?' + url = '?' return license, url def _check_results(self, input):