summaryrefslogtreecommitdiff
path: root/django/http/__init__.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-08-09 14:36:05 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-08-09 14:36:05 +0200
commit5c09c59bc76510a5388623259b3827ee894cd66b (patch)
treea9252f998a44c6a78252168332d1a12cd3d9b499 /django/http/__init__.py
parent96a6912ec5183e2b338bf2e1b655ea10760bfb54 (diff)
[py3] Renamed `next` to `__next__` in iterators.
See PEP 3114. `next` is retained as an alias for Python 2.
Diffstat (limited to 'django/http/__init__.py')
-rw-r--r--django/http/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index cc138917b9..05824ad1d9 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -669,12 +669,14 @@ class HttpResponse(object):
self._iterator = iter(self._container)
return self
- def next(self):
+ def __next__(self):
chunk = next(self._iterator)
if isinstance(chunk, six.text_type):
chunk = chunk.encode(self._charset)
return str(chunk)
+ next = __next__ # Python 2 compatibility
+
def close(self):
if hasattr(self._container, 'close'):
self._container.close()