From 25b1f3fe8cc23f0ab35d2178db7de1d081760b61 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Sun, 29 Nov 2020 19:04:35 +0100 Subject: [PATCH] Ignore non version number entries in build_tools_path LooseVersion('debian') stay a string and results in a type error. --- fdroidserver/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 932ab28a..d821375a 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -482,8 +482,11 @@ def find_apksigner(): for f in sorted(os.listdir(build_tools_path), reverse=True): if not os.path.isdir(os.path.join(build_tools_path, f)): continue - if LooseVersion(f) < LooseVersion(MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION): - return None + try: + if LooseVersion(f) < LooseVersion(MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION): + return None + except TypeError: + continue if os.path.exists(os.path.join(build_tools_path, f, 'apksigner')): apksigner = os.path.join(build_tools_path, f, 'apksigner') logging.info("Using %s " % apksigner)