abstract_get_bases() has logically 4 return states: 1. getattr(cls, '__bases__') could raise an AttributeError 2. getattr(cls, '__bases__') could raise some other exception 3. getattr(cls, '__bases__') could return a tuple 4. getattr(cls, '__bases__') could return something other than a tuple Only state #3 returns Some(tuple). AttributeErrors are masked by returning None. If an object other than
(&self, vm: &VirtualMachine)
| 436 | /// If an object other than a tuple comes out of __bases__, then again, None is returned. |
| 437 | /// Other exceptions are propagated. |
| 438 | fn abstract_get_bases(&self, vm: &VirtualMachine) -> PyResult<Option<PyTupleRef>> { |
| 439 | match vm.get_attribute_opt(self.to_owned(), identifier!(vm, __bases__))? { |
| 440 | Some(bases) => { |
| 441 | // Check if it's a tuple |
| 442 | match PyTupleRef::try_from_object(vm, bases) { |
| 443 | Ok(tuple) => Ok(Some(tuple)), |
| 444 | Err(_) => Ok(None), // Not a tuple, return None |
| 445 | } |
| 446 | } |
| 447 | None => Ok(None), // AttributeError was masked |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | fn abstract_issubclass(&self, cls: &Self, vm: &VirtualMachine) -> PyResult<bool> { |
| 452 | // Store the current derived class to check |
no test coverage detected