MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_executable_path

Function get_executable_path

crates/vm/src/getpath.rs:359–370  ·  view source on GitHub ↗

Get the current executable path

()

Source from the content-addressed store, hash-verified

357
358/// Get the current executable path
359fn get_executable_path() -> Option<PathBuf> {
360 #[cfg(not(target_arch = "wasm32"))]
361 {
362 let exec_arg = env::args_os().next()?;
363 which::which(exec_arg).ok()
364 }
365 #[cfg(target_arch = "wasm32")]
366 {
367 let exec_arg = env::args().next()?;
368 Some(PathBuf::from(exec_arg))
369 }
370}
371
372/// Parse pyvenv.cfg and extract the 'home' key value
373fn parse_pyvenv_home(pyvenv_cfg: &Path) -> Option<String> {

Callers 1

init_path_configFunction · 0.85

Calls 4

whichFunction · 0.85
okMethod · 0.80
SomeClass · 0.50
nextMethod · 0.45

Tested by

no test coverage detected