human
Complete the below
def execute_on_completion(application, config, callback):

    ''''Call callback(environ) once complete response is sent'
    '''
 ... Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def inner(environ, start_response):
        try:
            result = application(environ, start_response)
        except:
            callback(environ)
            raise
        return generate_close_and_callback(result, callback, environ)
    return inner