diff --git a/django/contrib/gis/geos/linestring.py b/django/contrib/gis/geos/linestring.py index eb339658e9..dd220d2bc3 100644 --- a/django/contrib/gis/geos/linestring.py +++ b/django/contrib/gis/geos/linestring.py @@ -92,8 +92,7 @@ class LineString(LinearGeometryMixin, GEOSGeometry): def __iter__(self): "Allow iteration over this LineString." - for i in range(len(self)): - yield self[i] + return iter(self._cs) def __len__(self): "Return the number of points in this LineString."