py/runtime: mp_convert_member_lookup: Fix type lookup aspects.
Don't try to wrap in checked_fun object's method looked up via subclass,
e.g. Cls.__init__.
TODO: This actually may be problematic if we deal with method inherited
from another native type, not "object".
@@ -1052,7 +1052,7 @@ void mp_convert_member_lookup(mp_obj_t self, const mp_obj_type_t *type, mp_obj_t
|| m_type == &mp_type_fun_builtin_2
|| m_type == &mp_type_fun_builtin_3
|| m_type == &mp_type_fun_builtin_var)
- && type != &mp_type_object) {
+ && !mp_obj_is_instance_type(type) && type != &mp_type_object) {
// we extracted a builtin method without a first argument, so we must
// wrap this function in a type checker
// Note that object will do its own checking so shouldn't be wrapped.
