X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/86b43dc605cd7e02e08b8c63c90ffe41ab26e3d2..3fb739de9275680d4f482d363f22c535442f0017:/nominatim/utils/json_writer.py?ds=inline 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