summaryrefslogtreecommitdiff
path: root/wsgitools
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools')
-rw-r--r--wsgitools/filters.py4
-rw-r--r--wsgitools/scgi/__init__.py4
-rw-r--r--wsgitools/scgi/forkpool.py4
3 files changed, 9 insertions, 3 deletions
diff --git a/wsgitools/filters.py b/wsgitools/filters.py
index 4c7ff20..4305c9d 100644
--- a/wsgitools/filters.py
+++ b/wsgitools/filters.py
@@ -35,7 +35,7 @@ class CloseableIterator:
@rtype: gen()
"""
return self
- def next(self):
+ def __next__(self):
"""iterator interface"""
if not self.iterators:
raise StopIteration
@@ -44,6 +44,8 @@ class CloseableIterator:
except StopIteration:
self.iterators.pop(0)
return next(self)
+ def next(self):
+ return self.__next__()
__all__.append("CloseableList")
class CloseableList(list):
diff --git a/wsgitools/scgi/__init__.py b/wsgitools/scgi/__init__.py
index cbe7a80..4e60b74 100644
--- a/wsgitools/scgi/__init__.py
+++ b/wsgitools/scgi/__init__.py
@@ -45,13 +45,15 @@ class FileWrapper:
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
assert self.offset <= 0
self.offset = -1
data = self.filelike.read(self.blksize)
if data:
return data
raise StopIteration
+ def next(self):
+ return self.__next__()
def _convert_environ(environ, multithread=False, multiprocess=False,
run_once=False):
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py
index 1bf0c6f..7cc6d18 100644
--- a/wsgitools/scgi/forkpool.py
+++ b/wsgitools/scgi/forkpool.py
@@ -135,7 +135,7 @@ class SocketFileWrapper:
def __iter__(self):
"""see pep333"""
return self
- def next(self):
+ def __next__(self):
"""
see pep333
@raise socket.error:
@@ -144,6 +144,8 @@ class SocketFileWrapper:
if not data:
raise StopIteration
return data
+ def next(self):
+ return self.__next__()
def flush(self):
"""see pep333"""
pass