Skip to content

Commit

Permalink
pythongh-113117: Fix the macOS framework installer build
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Dec 19, 2023
1 parent 893c9cc commit 770fe16
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@ _Py_Sigset_Converter(PyObject *obj, void *addr)
** man environ(7).
*/
#include <crt_externs.h>
#define USE_DARWIN_NS_GET_ENVIRON 1
#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
extern char **environ;
#endif /* !_MSC_VER */
Expand All @@ -1579,7 +1580,7 @@ convertenviron(void)
through main() instead of wmain(). */
(void)_wgetenv(L"");
e = _wenviron;
#elif defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
#elif defined(USE_DARWIN_NS_GET_ENVIRON)
/* environ is not accessible as an extern in a shared object on OSX; use
_NSGetEnviron to resolve it. The value changes if you add environment
variables between calls to Py_Initialize, so don't cache the value. */
Expand Down Expand Up @@ -7167,7 +7168,11 @@ py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *a
}

if (env == Py_None) {
#if defined(USE_DARWIN_NS_GET_ENVIRON)
envlist = *_NSGetEnviron();
#else
envlist = environ;
#endif
} else {
envlist = parse_envlist(env, &envc);
if (envlist == NULL) {
Expand Down

0 comments on commit 770fe16

Please sign in to comment.