()
| 30 | } |
| 31 | |
| 32 | fn enderpy_root_path() -> Result<PathBuf> { |
| 33 | let mut path = std::env::current_exe().into_diagnostic()?; |
| 34 | let enderpy_dir = loop { |
| 35 | path.push("Cargo.toml"); |
| 36 | if path.is_file() { |
| 37 | break path.parent().unwrap().to_path_buf(); |
| 38 | } |
| 39 | // Pop off "Cargo.toml" and the current directory name. |
| 40 | if !path.pop() || !path.pop() { |
| 41 | bail!("Unable to find enderpy_dir."); |
| 42 | } |
| 43 | }; |
| 44 | Ok(enderpy_dir) |
| 45 | } |
| 46 | |
| 47 | pub fn default_python_path() -> Result<PathBuf> { |
| 48 | let mut result = which("python"); |
no outgoing calls
no test coverage detected