summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-13 01:39:50 (GMT)
committerGitHub <noreply@github.com>2021-10-13 01:39:50 (GMT)
commit489176e4285314f9ea87b8bd91fe1d55d9af2c42 (patch)
tree66812e687f9136f54fe230944d1b4c71919e53f2 /Include
parent9c4766772cda67648184f8ddba546a5fc0167f91 (diff)
downloadcpython-489176e4285314f9ea87b8bd91fe1d55d9af2c42.zip
cpython-489176e4285314f9ea87b8bd91fe1d55d9af2c42.tar.gz
cpython-489176e4285314f9ea87b8bd91fe1d55d9af2c42.tar.bz2
bpo-45434: Convert Py_GETENV() macro to a function (GH-28912)
Avoid calling directly getenv() in the header file.
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/pydebug.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/cpython/pydebug.h b/Include/cpython/pydebug.h
index 78bcb11..cab799f 100644
--- a/Include/cpython/pydebug.h
+++ b/Include/cpython/pydebug.h
@@ -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
}