[pypy-issue] Issue #3009: Py_GETENV missing in cpyext (pypy/pypy)

asottile at bitbucket.org asottile at bitbucket.org
Sun Apr 28 20:00:58 EDT 2019

New issue 3009: Py_GETENV missing in cpyext

Anthony Sottile:

In cpython it is defined in `pydebug.h`: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Include/pydebug.h#L31-L34

Here's the macro in its entirety:

#define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s))

I'm working around this as follows:


/* pypy does not have a Py_GETENV */
#ifndef Py_GETENV
#define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s))

More information about the pypy-issue mailing list