xref: /unit/test/python/close_error/wsgi.py (revision 743:e0f0cd7d244a)
1603Szelenkov@nginx.comclass application:
2603Szelenkov@nginx.com    def __init__(self, environ, start_response):
3603Szelenkov@nginx.com        self.environ = environ
4603Szelenkov@nginx.com        self.start = start_response
5603Szelenkov@nginx.com
6603Szelenkov@nginx.com    def __iter__(self):
7603Szelenkov@nginx.com        self.start('200', [(('!', '0'))])
8617Szelenkov@nginx.com        yield b''
9603Szelenkov@nginx.com
10603Szelenkov@nginx.com    def close(self):
11*743Smax.romanov@nginx.com        self.environ['wsgi.errors'].write('Close called.\n')
12*743Smax.romanov@nginx.com        self.environ['wsgi.errors'].flush()
13