X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5751686fdce33f6b69a93dd1641ceacb2239791f..0278ab7f41bf9bc96a87084c04bfec263c6acc40:/nominatim/utils/json_writer.py diff --git a/nominatim/utils/json_writer.py b/nominatim/utils/json_writer.py index bb642233..fcc355d5 100644 --- a/nominatim/utils/json_writer.py +++ b/nominatim/utils/json_writer.py @@ -76,8 +76,8 @@ class JsonWriter: def end_array(self) -> 'JsonWriter': """ Write the closing bracket of a JSON array. """ - assert self.pending in (',', '[', '') - if self.pending == '[': + assert self.pending in (',', '[', ']', ')', '') + if self.pending not in (',', ''): self.data.write(self.pending) self.pending = ']' return self