summaryrefslogtreecommitdiff
path: root/wsgitools/adapters.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2009-03-29 17:42:48 +0200
committerHelmut Grohne <helmut@subdivi.de>2009-03-29 17:42:48 +0200
commit5c0a3965cdb9cac87d0b0ea773a6276c73a27ba6 (patch)
tree56619fbd0631ae08e01adca15e2994c689dfe8b4 /wsgitools/adapters.py
parentac99754f5e68f3731b7bdd7c8070c58346983bf4 (diff)
downloadwsgitools-5c0a3965cdb9cac87d0b0ea773a6276c73a27ba6.tar.gz
quite some changes for py3
These changes introduce some compatibility code. They don't make wsgitools usable with Python 3.0, but they also don't break compatibility with Python 2.5.
Diffstat (limited to 'wsgitools/adapters.py')
-rw-r--r--wsgitools/adapters.py8
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]))