We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c47667 commit 489176eCopy full SHA for 489176e
2 files changed
Include/cpython/pydebug.h
@@ -29,7 +29,7 @@ PyAPI_DATA(int) Py_LegacyWindowsStdioFlag;
29
/* this is a wrapper around getenv() that pays attention to
30
Py_IgnoreEnvironmentFlag. It should be used for getting variables like
31
PYTHONPATH and PYTHONHOME from the environment */
32
-#define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s))
+PyAPI_DATA(char*) Py_GETENV(const char *name);
33
34
#ifdef __cplusplus
35
}
Python/initconfig.c
@@ -249,6 +249,14 @@ _Py_GetGlobalVariablesAsDict(void)
249
#undef SET_ITEM_STR
250
251
252
+char*
253
+Py_GETENV(const char *name)
254
+{
255
+ if (Py_IgnoreEnvironmentFlag) {
256
+ return NULL;
257
+ }
258
+ return getenv(name);
259
+}
260
261
/* --- PyStatus ----------------------------------------------- */
262
0 commit comments