• Damien George's avatar
    py/runtime: Add mp_load_method_protected helper which catches exceptions · bc87b862
    Damien George authored
    This new helper function acts like mp_load_method_maybe but is wrapped in
    an NLR handler so it can catch exceptions.  It prevents AttributeError from
    propagating out, and optionally all other exceptions.  This helper can be
    used to fully implement hasattr (see follow-up commit), and also for cases
    where mp_load_method_maybe is used but it must now raise an exception.
    bc87b862
runtime.h 7.56 KB