From 3f8d6215e89ad35d16fd63dcd5010d6d9d4349ab Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Thu, 24 Sep 2020 17:05:20 +0200 Subject: [PATCH] Replace map with filter in parse_promtime --- wmn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmn.py b/wmn.py index ac62d95..c37533b 100644 --- a/wmn.py +++ b/wmn.py @@ -220,7 +220,7 @@ def process_prometheus_request(): if match is None: print('parse_promtime failed, because promtime', date_string, 'could not be parsed with pattern', promtime_to_isotime_pattern, file=sys.stderr, flush=True) abort(400) - grps = list(map(lambda x: x is not None, match.groups())) + grps = list(filter(lambda x: x is not None, match.groups())) if grps[-1] == 'Z': grps[-1] = '+00:00' return datetime.fromisoformat(''.join(grps))