bpo-45434: Convert Py_GETENV() macro to a function (GH-28912)

Avoid calling directly getenv() in the header file.
This commit is contained in:
Victor Stinner 2021-10-13 03:39:50 +02:00 committed by GitHub
parent 9c4766772c
commit 489176e428
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -249,6 +249,14 @@ fail:
#undef SET_ITEM_STR
}
char*
Py_GETENV(const char *name)
{
if (Py_IgnoreEnvironmentFlag) {
return NULL;
}
return getenv(name);
}
/* --- PyStatus ----------------------------------------------- */