X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5751686fdce33f6b69a93dd1641ceacb2239791f..78c19bc006d5957f183968d086226be4b2b65fe3:/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