mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-45434: Convert Py_GETENV() macro to a function (GH-28912)
Avoid calling directly getenv() in the header file.
This commit is contained in:
parent
9c4766772c
commit
489176e428
2 changed files with 9 additions and 1 deletions
|
@ -249,6 +249,14 @@ fail:
|
|||
#undef SET_ITEM_STR
|
||||
}
|
||||
|
||||
char*
|
||||
Py_GETENV(const char *name)
|
||||
{
|
||||
if (Py_IgnoreEnvironmentFlag) {
|
||||
return NULL;
|
||||
}
|
||||
return getenv(name);
|
||||
}
|
||||
|
||||
/* --- PyStatus ----------------------------------------------- */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue