Skip to content

Commit

Permalink
Check path-like interpreter arguments when cross compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Feb 3, 2023
1 parent ec9c99a commit 8f8803b
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 8f8803b

Please sign in to comment.