[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
https://bitbucket.org/pypy/pypy/issues/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:

https://github.com/asottile/future-breakpoint/blob/c2d2a2d106895837ffd8e30be2578bf755b1b5af/_future_breakpoint.c#L13-L16

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




More information about the pypy-issue mailing list