human
Complete this python program:
def _build_precondition_join_fn(cls, fn):
assistant
#Here is the Python code you requested.

    """Build a check_precondition function that uses both the old precondition check as well as the new function fn
    cls: class whose check_precondition should be used as a base
    fn: check_precondition function to check
    Returns a function that can replace a handler check_precondition method
    """
    old_precondition = cls.check_precondition
    def check_precondition():
        (result, message) = fn()
        if (not result):
            return (result, message)
        return old_precondition()
    return staticmethod(check_precondition)