Method
from_pyc_path
(path: &std::path::Path, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 428 | ); |
| 429 | } |
| 430 | pub fn from_pyc_path(path: &std::path::Path, vm: &VirtualMachine) -> PyResult<PyRef<Self>> { |
| 431 | let name = match path.file_stem() { |
| 432 | Some(stem) => stem.display().to_string(), |
| 433 | None => "".to_owned(), |
| 434 | }; |
| 435 | let content = std::fs::read(path).map_err(|e| e.to_pyexception(vm))?; |
| 436 | Self::from_pyc( |
| 437 | &content, |
| 438 | Some(&name), |
| 439 | Some(&path.display().to_string()), |
| 440 | Some("<source>"), |
| 441 | vm, |
| 442 | ) |
| 443 | } |
| 444 | pub fn from_pyc( |
| 445 | pyc_bytes: &[u8], |
| 446 | name: Option<&str>, |
Callers
nothing calls this directly
Tested by
no test coverage detected