From 11dc8c9f2415227b53fbda8da5e85b661b6c8833 Mon Sep 17 00:00:00 2001 From: Al Date: Sun, 25 Dec 2016 00:49:57 -0500 Subject: [PATCH] [fix] non-dict keys in OSM boundary configs --- scripts/geodata/osm/components.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/geodata/osm/components.py b/scripts/geodata/osm/components.py index 376ac445..7d566686 100644 --- a/scripts/geodata/osm/components.py +++ b/scripts/geodata/osm/components.py @@ -74,6 +74,10 @@ class OSMAddressComponents(object): data = yaml.load(open(os.path.join(boundaries_dir, filename))) for prop, values in six.iteritems(data): + if not hasattr(values, 'items'): + # non-dict key + continue + for k, v in values.iteritems(): if isinstance(v, six.string_types) and v not in AddressFormatter.address_formatter_fields: raise ValueError(u'Invalid value in {} for prop={}, key={}: {}'.format(filename, prop, k, v))