(&self, vm: &VirtualMachine)
| 245 | |
| 246 | #[pymethod] |
| 247 | fn exception(&self, vm: &VirtualMachine) -> PyResult { |
| 248 | match self.fut_state.load() { |
| 249 | FutureState::Pending => Err(new_invalid_state_error(vm, "Exception is not set.")), |
| 250 | FutureState::Cancelled => { |
| 251 | let exc = self.make_cancelled_error_impl(vm); |
| 252 | Err(exc) |
| 253 | } |
| 254 | FutureState::Finished => { |
| 255 | self.fut_log_tb.store(false, Ordering::Relaxed); |
| 256 | Ok(self |
| 257 | .fut_exception |
| 258 | .read() |
| 259 | .clone() |
| 260 | .unwrap_or_else(|| vm.ctx.none())) |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | #[pymethod] |
| 266 | fn set_result(zelf: PyRef<Self>, result: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> { |
nothing calls this directly
no test coverage detected