INNER CODE UNIT · Rust

validate_python

EricLBuehler/mistral.rs · mistralrs-code-exec/src/lib.rs:248

async fn validate_python(python_path: &Path) -> anyhow::Result<()> {
    let output = tokio::process::Command::new(python_path)
        .arg("--version")
        .output()
        .await
        .map_err(|e| {
            anyhow::anyhow!(
                "Python interpreter not found at '{}': {e}",
                python_path.display()
            )
        })?;
    if !output.status.success() {
        anyhow::bail!(
            "Python interpreter at '{}' returned non-zero status",
            python_path.display()
        );
    }
    Ok(())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…