(&self, exc: &PyObject, vm: &VirtualMachine)
| 430 | |
| 431 | impl ConditionMatcher { |
| 432 | fn check(&self, exc: &PyObject, vm: &VirtualMachine) -> PyResult<bool> { |
| 433 | match self { |
| 434 | ConditionMatcher::Type(typ) => Ok(exc.fast_isinstance(typ)), |
| 435 | ConditionMatcher::Types(types) => Ok(types.iter().any(|t| exc.fast_isinstance(t))), |
| 436 | ConditionMatcher::Callable(func) => { |
| 437 | let result = func.call((exc.to_owned(),), vm)?; |
| 438 | result.try_to_bool(vm) |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | fn derive_and_copy_attributes( |
no test coverage detected