- Get _environ through the NSEnviron call in a MacOSX framework. This allows

us to completely decouple the framework from the executable, so we
  can use a two-level namespace.
- Do framework builds with a twolevel namespace.
- Reorganized the code that creates the minimal framework in the build
  directory, to make it more robust against incomplete frameworks (from
  earlier aborted builds, or builds of previous Python versions).
This commit is contained in:
Jack Jansen 2002-08-01 21:57:49 +00:00
parent be3e1f7a95
commit ea0c3828c0
4 changed files with 39 additions and 53 deletions

View file

@ -276,8 +276,13 @@ extern int lstat(const char *, struct stat *);
#endif
/* Return a dictionary corresponding to the POSIX environment table */
#if !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
#ifdef WITH_NEXT_FRAMEWORK
/* On Darwin/MacOSX a shared library or framework has no access to
** environ directly, we must obtain it with _NSGetEnviron().
*/
#include <crt_externs.h>
static char **environ;
#elif !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
extern char **environ;
#endif /* !_MSC_VER */
@ -289,6 +294,10 @@ convertenviron(void)
d = PyDict_New();
if (d == NULL)
return NULL;
#ifdef WITH_NEXT_FRAMEWORK
if (environ == NULL)
environ = *_NSGetEnviron();
#endif
if (environ == NULL)
return d;
/* This part ignores errors */