Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 Include/cpython/pydebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PyAPI_DATA(int) Py_LegacyWindowsStdioFlag;
/* this is a wrapper around getenv() that pays attention to
Py_IgnoreEnvironmentFlag. It should be used for getting variables like
PYTHONPATH and PYTHONHOME from the environment */
#define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s))
PyAPI_DATA(char*) Py_GETENV(const char *name);

#ifdef __cplusplus
}
Expand Down
8 changes: 8 additions & 0 deletions 8 Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ _Py_GetGlobalVariablesAsDict(void)
#undef SET_ITEM_STR
}

char*
Py_GETENV(const char *name)
{
if (Py_IgnoreEnvironmentFlag) {
return NULL;
}
return getenv(name);
}

/* --- PyStatus ----------------------------------------------- */

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.