diff options
Diffstat (limited to 'wsgitools/adapters.py')
-rw-r--r-- | wsgitools/adapters.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/wsgitools/adapters.py b/wsgitools/adapters.py index 6f9c203..6c6bbca 100644 --- a/wsgitools/adapters.py +++ b/wsgitools/adapters.py @@ -9,6 +9,12 @@ __all__ = [] from wsgitools.filters import CloseableIterator, CloseableList +try: + next +except NameError: + def next(it): + return it.next() + __all__.append("WSGI2to1Adapter") class WSGI2to1Adapter: """Adapts an application with an interface that might somewhen be known as @@ -57,7 +63,7 @@ class WSGI1to2Adapter: close_function = getattr(iterable, "close", None) iterable = iter(iterable) try: - first = iterable.next() + first = next(iterable) except StopIteration: return (results[0], results[1], CloseableList(close_function, results[2])) |