From 19dceaa9581d92770b8fcfb8f121b848a8868dea Mon Sep 17 00:00:00 2001 From: PerryKMC Date: Fri, 11 May 2018 22:33:51 +0800 Subject: [PATCH] Fixed api output for build=False #93 --- overpass/api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/overpass/api.py b/overpass/api.py index 861a88facb9..bf2f20be1f5 100644 --- a/overpass/api.py +++ b/overpass/api.py @@ -81,10 +81,13 @@ def get(self, for row in reader: result.append(row) return result - elif content_type == "text/xml" or content_type == "application/xml": + elif content_type in ("text/xml", "application/xml", "application/osm3s+xml"): return r.text + elif content_type == "application/json": + response = json.loads(r.text) - response = json.loads(r.text) + if not build: + return response # Check for valid answer from Overpass. # A valid answer contains an 'elements' key at the root level.