Ticket #277: WSGIFilter-rhs_generator_shortcut.patch

File WSGIFilter-rhs_generator_shortcut.patch, 0.9 KB (added by tseaver, 4 years ago)
  • wsgifilter/filter.py

    old new  
    7575        if shortcutted: 
    7676            # We chose not to filter 
    7777            return app_iter 
    78         if not captured or written_output: 
     78        if (not captured) or written_output: 
    7979            # This app hasn't called start_response We can't do 
    8080            # anything magic with it; or it used the start_response 
    8181            # writer, and we still can't do anything with it 
     
    8686                if hasattr(app_iter, 'close'): 
    8787                    app_iter.close() 
    8888            app_iter = written_output 
     89        if shortcutted: 
     90            # We chose not to filter (delayed due to RHS generator) 
     91            return app_iter 
    8992        try: 
    9093            return self.filter_output( 
    9194                environ, start_response,