diff options
author | Chris Dent <chris.dent@gmail.com> | 2018-10-23 18:52:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 18:52:34 +0100 |
commit | bd13d07eb59cb92f32a3ac150cf132e8b2965fb1 (patch) | |
tree | 8f5aefb72b21d6d0ee52bcc5ce218fe7186a936d | |
parent | bbff834a3e63c59141b22fefd8b3bbb8aa67762b (diff) | |
parent | 10e5c641ecd45d896d25b0511438c9a9ce3c59e4 (diff) | |
download | paste-git-bd13d07eb59cb92f32a3ac150cf132e8b2965fb1.tar.gz |
Merge pull request #3 from zaneb/py3
Python 3 fixes
-rw-r--r-- | paste/auth/digest.py | 3 | ||||
-rw-r--r-- | paste/cgitb_catcher.py | 2 | ||||
-rwxr-xr-x | paste/httpserver.py | 1 | ||||
-rw-r--r-- | paste/wsgilib.py | 3 |
4 files changed, 6 insertions, 3 deletions
diff --git a/paste/auth/digest.py b/paste/auth/digest.py index 553bd88..8c8690c 100644 --- a/paste/auth/digest.py +++ b/paste/auth/digest.py @@ -52,12 +52,11 @@ def _split_auth_string(auth_string): prev = item continue else: - raise StopIteration + return yield prev.strip() prev = item yield prev.strip() - return def _auth_to_kv_pairs(auth_string): """ split a digest auth string into key, value pairs """ diff --git a/paste/cgitb_catcher.py b/paste/cgitb_catcher.py index f88ffb8..0bb8e14 100644 --- a/paste/cgitb_catcher.py +++ b/paste/cgitb_catcher.py @@ -55,7 +55,7 @@ class CgitbMiddleware(object): def catching_iter(self, app_iter, environ): if not app_iter: - raise StopIteration + return error_on_close = False try: for v in app_iter: diff --git a/paste/httpserver.py b/paste/httpserver.py index 11489b0..8bacfbc 100755 --- a/paste/httpserver.py +++ b/paste/httpserver.py @@ -513,6 +513,7 @@ class LimitedLengthFile(object): if self.length - self._consumed <= 0: raise StopIteration return self.readline() + __next__ = next ## Optional methods ## diff --git a/paste/wsgilib.py b/paste/wsgilib.py index d5862e7..7993f29 100644 --- a/paste/wsgilib.py +++ b/paste/wsgilib.py @@ -126,6 +126,7 @@ class chained_app_iters(object): except StopIteration: self.chained.pop(0) return self.next() + __next__ = next def close(self): self._closed = True @@ -216,6 +217,7 @@ class _wrap_app_iter(object): except: self.error_callback(sys.exc_info()) raise + __next__ = next def catch_errors_app(application, environ, start_response, error_callback_app, ok_callback=None, catch=Exception): @@ -278,6 +280,7 @@ class _wrap_app_iter_app(object): self.close = new_app_iterable.close self.next = app_iter.next return self.next() + __next__ = next def raw_interactive(application, path='', raise_on_wsgi_error=False, **environ): |