diff options
author | Helmut Grohne <helmut@subdivi.de> | 2008-07-12 14:59:29 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2008-07-12 14:59:29 +0200 |
commit | 6be7a46a36c06f80e10565b74dbf0f44a6f4656a (patch) | |
tree | 370bc11717ab68f64aa77d2d2588f1b1ba52f858 | |
parent | 1ce39d0d95535fd214a69a5b2194918eaa8b25e5 (diff) | |
download | wsgitools-6be7a46a36c06f80e10565b74dbf0f44a6f4656a.tar.gz |
optimize adapter to not mangle data when unnecessary
-rw-r--r-- | wsgitools/adapters.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/wsgitools/adapters.py b/wsgitools/adapters.py index 5a4983b..6f9c203 100644 --- a/wsgitools/adapters.py +++ b/wsgitools/adapters.py @@ -48,6 +48,8 @@ class WSGI1to2Adapter: return write_callable iterable = self.app(environ, start_response) assert hasattr(iterable, "__iter__") + if not results[2]: + return results[0], results[1], iterable if isinstance(iterable, list): # retaining .close attribute this way iterable[:0] = results[2] |