mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
fix PyMethod::get to use vm.get_attribute
As cpython implementation, if `getattro` slot is not `PyBaseObject::getattro`, then use `vm.get_attribute` not slot method. Signed-off-by: snowapril <sinjihng@gmail.com>
This commit is contained in:
1 parent
1bff6a38d1
commit
46347aa6d4
1 file changed
+1
-1
+1
-1
@@ -1047,7 +1047,7 @@ impl PyMethod {
|
||||
let getattro = cls.mro_find_map(|cls| cls.slots.getattro.load()).unwrap();
|
||||
if getattro as usize != object::PyBaseObject::getattro as usize {
|
||||
drop(cls);
|
||||
return getattro(obj, name, vm).map(Self::Attribute);
|
||||
return obj.get_attr(name, vm).map(Self::Attribute);
|
||||
}
|
||||
|
||||
let mut is_method = false;
|
||||
|
||||
Reference in new issue
Block a user