| 88 | | if not result_: |
|---|
| 89 | | raise Exception('Invalid WSGI response, did the application return an iterable?') |
|---|
| 90 | | if result_[-1] is None: |
|---|
| 91 | | # The check failed and the initial app should be used. |
|---|
| 92 | | return app_iter |
|---|
| 93 | | else: |
|---|
| 94 | | # Close the unused app which we don't want |
|---|
| 95 | | if hasattr(app_iter, 'close'): |
|---|
| 96 | | app_iter.close() |
|---|
| 97 | | return result_[-1] |
|---|
| | 88 | # if not result_: |
|---|
| | 89 | # raise Exception('Invalid WSGI response (%r), did the application return an iterable?'%result_) |
|---|
| | 90 | # if result_[-1] is None: |
|---|
| | 91 | # # The check failed and the initial app should be used. |
|---|
| | 92 | # return app_iter |
|---|
| | 93 | # else: |
|---|
| | 94 | # # Close the unused app which we don't want |
|---|
| | 95 | # if hasattr(app_iter, 'close'): |
|---|
| | 96 | # app_iter.close() |
|---|
| | 97 | # return result_[-1] |
|---|
| | 98 | for data in app_iter: |
|---|
| | 99 | yield data |
|---|
| | 100 | if hasattr(app_iter, 'close'): |
|---|
| | 101 | app_iter.close() |
|---|
| | 102 | #return result_[-1] |
|---|