make sure patterns are strings

fixes #31978

(cherry picked from commit ab8bacdf5e)
pull/32201/head
Brian Coca 8 years ago committed by Toshio Kuratomi
parent 265652212d
commit fa2a18a740

@ -85,11 +85,12 @@ def split_host_pattern(pattern):
if isinstance(pattern, list): if isinstance(pattern, list):
return list(itertools.chain(*map(split_host_pattern, pattern))) return list(itertools.chain(*map(split_host_pattern, pattern)))
elif not isinstance(pattern, string_types):
pattern = to_native(pattern)
# If it's got commas in it, we'll treat it as a straightforward # If it's got commas in it, we'll treat it as a straightforward
# comma-separated list of patterns. # comma-separated list of patterns.
if ',' in pattern:
elif ',' in pattern:
patterns = re.split('\s*,\s*', pattern) patterns = re.split('\s*,\s*', pattern)
# If it doesn't, it could still be a single pattern. This accounts for # If it doesn't, it could still be a single pattern. This accounts for

Loading…
Cancel
Save