| 397 | |
| 398 | #[cfg(feature = "parser")] |
| 399 | pub(crate) fn wrap_interactive(vm: &VirtualMachine, module_obj: PyObjectRef) -> PyResult { |
| 400 | if !module_obj.class().is(pyast::NodeModModule::static_type()) { |
| 401 | return Err(vm.new_type_error("expected Module node")); |
| 402 | } |
| 403 | let body = get_node_field(vm, &module_obj, "body", "Module")?; |
| 404 | let node = NodeAst |
| 405 | .into_ref_with_type(vm, pyast::NodeModInteractive::static_type().to_owned()) |
| 406 | .unwrap(); |
| 407 | let dict = node.as_object().dict().unwrap(); |
| 408 | dict.set_item("body", body, vm).unwrap(); |
| 409 | Ok(node.into()) |
| 410 | } |
| 411 | |
| 412 | #[cfg(feature = "parser")] |
| 413 | pub(crate) fn parse_func_type( |