From 80371da13384e9bf3c86bad3846860df7bb3b4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 18 Aug 2015 18:07:01 -0700 Subject: [PATCH] lint: better type safety --- fdroidserver/lint.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 9c59fd37..ee6eca7c 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -260,14 +260,14 @@ def main(): # Regex checks in all kinds of fields for f in regex_warnings: for m, r in regex_warnings[f]: - t = metadata.metafieldtype(f) - if t == 'string': - if app[f] is None: + v = app[f] + if type(v) == str: + if v is None: continue - if m.match(app[f]): + if m.match(v): warn("%s '%s': %s" % (f, app[f], r)) - elif t == 'multiline': - for l in app[f]: + elif type(v) == list: + for l in v: if m.match(l): warn("%s at line '%s': %s" % (f, l, r))