(zelf: &PyObject, name: &Py<PyStr>, vm: &VirtualMachine)
| 506 | } |
| 507 | |
| 508 | fn getattro_wrapper(zelf: &PyObject, name: &Py<PyStr>, vm: &VirtualMachine) -> PyResult { |
| 509 | let __getattribute__ = identifier!(vm, __getattribute__); |
| 510 | let __getattr__ = identifier!(vm, __getattr__); |
| 511 | match vm.call_special_method(zelf, __getattribute__, (name.to_owned(),)) { |
| 512 | Ok(r) => Ok(r), |
| 513 | Err(e) |
| 514 | if e.fast_isinstance(vm.ctx.exceptions.attribute_error) |
| 515 | && zelf.class().has_attr(__getattr__) => |
| 516 | { |
| 517 | vm.call_special_method(zelf, __getattr__, (name.to_owned(),)) |
| 518 | } |
| 519 | Err(e) => Err(e), |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | fn setattro_wrapper( |
| 524 | zelf: &PyObject, |
nothing calls this directly
no test coverage detected