MCPcopy Create free account
hub / github.com/0xKarl-dev/claw-codes / python_command

Function python_command

rust/crates/runtime/src/mcp_stdio.rs:1147–1163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1145 }
1146
1147 fn python_command() -> String {
1148 for key in ["MCP_TEST_PYTHON", "PYTHON3", "PYTHON"] {
1149 if let Ok(value) = std::env::var(key) {
1150 if !value.trim().is_empty() {
1151 return value;
1152 }
1153 }
1154 }
1155
1156 for candidate in ["python3", "python"] {
1157 if Command::new(candidate).arg("--version").output().is_ok() {
1158 return candidate.to_string();
1159 }
1160 }
1161
1162 panic!("expected a Python interpreter for MCP stdio tests")
1163 }
1164
1165 fn cleanup_script(script_path: &Path) {
1166 if let Err(error) = fs::remove_file(script_path) {

Callers 2

script_transportFunction · 0.85
manager_server_configFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected