Fix exact_match_regex() in case of empty pattern

This commit is contained in:
allegroai 2020-05-31 12:01:03 +03:00
parent 77d71819e8
commit 7b3a554fe9

View File

@ -122,4 +122,4 @@ def validate_dict(obj, key_types, value_types, desc=''):
def exact_match_regex(name): def exact_match_regex(name):
""" Convert string to a regex representing an exact match """ """ Convert string to a regex representing an exact match """
return '^%s$' % re.escape(name) return '^%s$' % re.escape(name or '')