From fc2efb6ba9f06b39434ce4d5545fd666ae6f075a Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sun, 16 Apr 2023 05:06:01 +0300 Subject: refactoring --- kvmd/validators/basic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kvmd/validators') diff --git a/kvmd/validators/basic.py b/kvmd/validators/basic.py index 059ec226..ba517bb8 100644 --- a/kvmd/validators/basic.py +++ b/kvmd/validators/basic.py @@ -113,9 +113,9 @@ def valid_string_list( if not isinstance(arg, (list, tuple)): arg = check_not_none_string(arg, name) arg = list(filter(None, re.split(delim, arg))) - if subval is not None: - try: - arg = list(map(subval, arg)) - except Exception: - raise ValidatorError(f"Failed sub-validator on one of the item of {arg!r}") + + try: + arg = list(map(subval, arg)) + except Exception: + raise ValidatorError(f"Failed sub-validator on one of the item of {arg!r}") return arg -- cgit v1.2.3