(
vm: &VirtualMachine,
source_file: &SourceFile,
object: PyObjectRef,
)
| 9 | } |
| 10 | } |
| 11 | fn ast_from_object( |
| 12 | vm: &VirtualMachine, |
| 13 | source_file: &SourceFile, |
| 14 | object: PyObjectRef, |
| 15 | ) -> PyResult<Self> { |
| 16 | let cls = object.class(); |
| 17 | Ok( |
| 18 | if cls.is(pyast::NodeExceptHandlerExceptHandler::static_type()) { |
| 19 | Self::ExceptHandler(ast::ExceptHandlerExceptHandler::ast_from_object( |
| 20 | vm, |
| 21 | source_file, |
| 22 | object, |
| 23 | )?) |
| 24 | } else { |
| 25 | return Err(vm.new_type_error(format!( |
| 26 | "expected some sort of excepthandler, but got {}", |
| 27 | object.repr(vm)? |
| 28 | ))); |
| 29 | }, |
| 30 | ) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | // constructor |
nothing calls this directly
no test coverage detected