(
vm: &VirtualMachine,
module_name: &str,
file_path: String,
content: &str,
)
| 124 | |
| 125 | #[cfg(feature = "rustpython-compiler")] |
| 126 | pub fn import_file( |
| 127 | vm: &VirtualMachine, |
| 128 | module_name: &str, |
| 129 | file_path: String, |
| 130 | content: &str, |
| 131 | ) -> PyResult { |
| 132 | let code = vm |
| 133 | .compile_with_opts( |
| 134 | content, |
| 135 | crate::compiler::Mode::Exec, |
| 136 | file_path, |
| 137 | vm.compile_opts(), |
| 138 | ) |
| 139 | .map_err(|err| vm.new_syntax_error(&err, Some(content)))?; |
| 140 | import_code_obj(vm, module_name, code, true) |
| 141 | } |
| 142 | |
| 143 | #[cfg(feature = "rustpython-compiler")] |
| 144 | pub fn import_source(vm: &VirtualMachine, module_name: &str, content: &str) -> PyResult { |
nothing calls this directly
no test coverage detected