gil: use CARGO_PACKAGE_VERSION env var

This commit is contained in:
David Hewitt 2021-01-09 14:42:46 +00:00
parent 364b7c2214
commit af9a58a8f9
1 changed files with 6 additions and 2 deletions

View File

@ -151,7 +151,9 @@ impl GILGuard {
"statically instead of with a shared library.\n\n",
"Please disable the `auto-initialize` feature, for example by entering the following ",
"in your cargo.toml:\n\n",
" pyo3 = { version = \"0.13.0\", default-features = false }\n\n",
" pyo3 = { version = \"",
env!("CARGO_PKG_VERSION"),
"\", default-features = false }\n\n",
"Alternatively, compile PyO3 using a Python distribution which contains a shared ",
"libary."
));
@ -160,7 +162,9 @@ impl GILGuard {
"The `auto-initialize` feature is not supported by PyPy.\n\n",
"Please disable the `auto-initialize` feature, for example by entering the following ",
"in your cargo.toml:\n\n",
" pyo3 = { version = \"0.13.0\", default-features = false }",
" pyo3 = { version = \"",
env!("CARGO_PKG_VERSION"),
"\", default-features = false }\n\n",
));
} else {
// extension module feature enabled and PyPy or static linking