diff --git a/build.rs b/build.rs index 60f8cc046c5..b896ebd0a64 100644 --- a/build.rs +++ b/build.rs @@ -849,8 +849,9 @@ fn abi3_without_interpreter() -> Result<()> { } fn main() -> Result<()> { - // If PYO3_NO_INTEPRETER is set with abi3, we can build PyO3 without calling Python (UNIX only). - if env::var_os("PYO3_NO_INTERPRETER").is_some() + // If PYO3_NO_PYTHON is set with abi3, we can build PyO3 without calling Python (UNIX only). + // We only check for the abi3-py3{ABI3_MAX_MINOR} because lower versions depend on it. + if env::var_os("PYO3_NO_PYTHON").is_some() && env::var_os(format!("CARGO_FEATURE_ABI3_PY3{}", ABI3_MAX_MINOR)).is_some() { return abi3_without_interpreter(); diff --git a/guide/src/building_and_distribution.md b/guide/src/building_and_distribution.md index 2940b1c3e55..6b013b54bf1 100644 --- a/guide/src/building_and_distribution.md +++ b/guide/src/building_and_distribution.md @@ -66,7 +66,7 @@ If you set more that one of these api version feature flags the highest version PyO3 is only able to link your extension module to api3 version up to and including your host Python version. E.g., if you set `abi3-py38` and try to compile the crate with a host of Python 3.6, the build will fail. As an advanced feature, you can build PyO3 wheel without calling Python interpreter with -the environment variable `PYO3_NO_INTERPRETER` set, but this only works on *NIX. +the environment variable `PYO3_NO_PYTHON` set, but this only works on *NIX. ## Cross Compiling