X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e1af6a22d357de51c86ac73582beba2b4419227b..3fb739de9275680d4f482d363f22c535442f0017:/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