diff options
author | Helmut Grohne <helmut@subdivi.de> | 2007-04-20 08:56:02 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2007-04-20 08:56:02 +0200 |
commit | d724bf10dbd7d625c8ad7fef8d8ad5dbde542772 (patch) | |
tree | 1e8722a6516cf20751cf66ded25afebda0d609a5 /wsgitools | |
parent | 6480e3e42fd3830ea59260dc035b0c8d5ae4f8f4 (diff) | |
download | wsgitools-d724bf10dbd7d625c8ad7fef8d8ad5dbde542772.tar.gz |
fix appen_data invocation in WSGIFilterMiddleware
Diffstat (limited to 'wsgitools')
-rw-r--r-- | wsgitools/filters.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wsgitools/filters.py b/wsgitools/filters.py index f892381..cfa6c36 100644 --- a/wsgitools/filters.py +++ b/wsgitools/filters.py @@ -144,9 +144,14 @@ class WSGIFilterMiddleware: [filter.filter_data(data) for data in ret] + list(filter.append_data())) ret = iter(ret) + def late_append_data(): + """Invoke filter.append_data() after filter_data() has seen all + data.""" + for data in filter.append_data(): + yield data return CloseableIterator(modified_close, (filter.filter_data(data) for data in ret), - filter.append_data()) + late_append_data()) __all__.append("RequestLogWSGIFilter") class RequestLogWSGIFilter(BaseWSGIFilter): |