xref: /unit/test/python/atexit/wsgi.py (revision 1848:4bd548074e2c)
1552Szelenkov@nginx.comimport atexit
2552Szelenkov@nginx.com
3*1848Szelenkov@nginx.com
4552Szelenkov@nginx.comdef application(environ, start_response):
5603Szelenkov@nginx.com    def at_exit():
6743Smax.romanov@nginx.com        environ['wsgi.errors'].write('At exit called.\n')
7743Smax.romanov@nginx.com        environ['wsgi.errors'].flush()
8552Szelenkov@nginx.com
9603Szelenkov@nginx.com    atexit.register(at_exit)
10552Szelenkov@nginx.com
11552Szelenkov@nginx.com    start_response('200', [('Content-Length', '0')])
12552Szelenkov@nginx.com    return []
13