Skip to content

Commit

Permalink
Merge pull request #1459 from messense/check-interpreter
Browse files Browse the repository at this point in the history
Check path-like interpreter arguments when cross compiling
  • Loading branch information
messense authored Feb 3, 2023
2 parents ec9c99a + 8f8803b commit 3cef2a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@ impl BuildOptions {
if interpreter.is_empty() && !self.find_interpreter {
bail!("Couldn't find any python interpreters. Please specify at least one with -i");
}
for interp in interpreter {
// If `-i` looks like a file path, check if it's a valid interpreter
if interp.components().count() > 1
&& PythonInterpreter::check_executable(interp, target, bridge)?
.is_none()
{
bail!("{} is not a valid python interpreter", interp.display());
}
}
interpreters =
find_interpreter_in_sysconfig(interpreter, target, min_python_minor)?;
}
Expand Down

0 comments on commit 3cef2a0

Please sign in to comment.