(raw: PyIntRef, vm: &VirtualMachine)
| 38 | const HAVE_ARGUMENT: i32 = 43; |
| 39 | |
| 40 | pub fn try_from_pyint(raw: PyIntRef, vm: &VirtualMachine) -> PyResult<Self> { |
| 41 | let instruction = raw |
| 42 | .try_to_primitive::<u16>(vm) |
| 43 | .and_then(|v| { |
| 44 | AnyInstruction::try_from(v).map_err(|_| { |
| 45 | vm.new_exception_empty(vm.ctx.exceptions.value_error.to_owned()) |
| 46 | }) |
| 47 | }) |
| 48 | .map_err(|_| vm.new_value_error("invalid opcode or oparg"))?; |
| 49 | |
| 50 | Ok(Self(instruction)) |
| 51 | } |
| 52 | |
| 53 | const fn inner(self) -> AnyInstruction { |
| 54 | self.0 |
nothing calls this directly
no test coverage detected