From af20b5e506d53bf20b9181ec8f544cfad2bd65da Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Tue, 16 Jan 2018 17:44:16 +0300 Subject: [PATCH] Fix case of list of strings --- conflate/conflate.py | 9 +++++++-- conflate/version.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/conflate/conflate.py b/conflate/conflate.py index dc1027b..84ccba6 100755 --- a/conflate/conflate.py +++ b/conflate/conflate.py @@ -209,9 +209,12 @@ class OsmConflator: if isinstance(tags, str): tag_strs = [tags] else: - if isinstance(tags[0][0], str): + if not isinstance(tags[0], str) and isinstance(tags[0][0], str): tags = [tags] for tags_q in tags: + if isinstance(tags_q, str): + tag_strs.append(tags_q) + continue tag_str = '' for t in tags_q: if len(t) == 1: @@ -989,9 +992,11 @@ def write_for_filter(profile, dataset, f): if isinstance(query, str): raise ValueError('Query string for filter should not be a string') result = [] - if isinstance(query[0][0], str): + if not isinstance(query[0], str) and isinstance(query[0][0], str): query = [query] for q in query: + if isinstance(q, str): + raise ValueError('Query string for filter should not be a string') parts = [] for part in q: if len(part) == 1: diff --git a/conflate/version.py b/conflate/version.py index 5a5df3b..19b4f1d 100644 --- a/conflate/version.py +++ b/conflate/version.py @@ -1 +1 @@ -__version__ = '1.2.3' +__version__ = '1.3.0'