Method
send
(&self, val: Option<PyObjectRef>, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 564 | impl AwaitPromise { |
| 565 | #[pymethod] |
| 566 | fn send(&self, val: Option<PyObjectRef>, vm: &VirtualMachine) -> PyResult<PyIterReturn> { |
| 567 | match self.obj.take() { |
| 568 | Some(prom) => { |
| 569 | if val.is_some() { |
| 570 | Err(vm.new_type_error("can't send non-None value to an AwaitPromise")) |
| 571 | } else { |
| 572 | Ok(PyIterReturn::Return(prom)) |
| 573 | } |
| 574 | } |
| 575 | None => Ok(PyIterReturn::StopIteration(val)), |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | #[pymethod] |
| 580 | fn throw( |
Tested by
no test coverage detected