human
Complete this python program:
def catch_exit_code(expected_exit_code):
assistant
#Here is the Python code you requested.

    """:param int expected_exit_code: The expected exit code of the process.
    :returns: An error handler function which accepts a 3-tuple(exception_type,
    exception, None) and re-raises ``exception`` if the exit code is not
    ``expected_exit_code`.
    """
    def error_handler(result):
        (exception_type, exception) = result[:2]
        if ((exception_type is not ProcessTerminated) or (exception.exitCode != expected_exit_code)):
            raise exception
    return error_handler