Commits

Amaury Forgeot d'Arc committed e4568fc

Fix cpyext tests, I hope I did not break Py_Initialize.

  • Participants
  • Parent commits a304268
  • Branches embedded-pypy

Comments (0)

Files changed (2)

File pypy/module/cpyext/pythonrun.py

 def Py_GetProgramName(space):
     """
     Return the program name set with Py_SetProgramName(), or the default.
-    The returned string points into static storage; the caller should not modify its
-    value."""
+    The returned string points into static storage; the caller should
+    not modify its value."""
     return space.fromcache(State).get_programname()
 
 @cpython_api([rffi.CCHARP], lltype.Void, error=CANNOT_FAIL)
 @cpython_api([rffi.CCHARP], lltype.Void, error=CANNOT_FAIL)
 def Py_SetPythonHome(space, home):
     """
-    Set the default “home” directory, that is, the location of the standard Python libraries.
+    Set the default "home" directory, that is, the location of the
+    standard Python libraries.
     """
     space.fromcache(State).set_pythonhome(home)
 
 ''').interphook('pypy_init')
 
 @cpython_api([], lltype.Void, error=CANNOT_FAIL)
-def PyPy_Initialize(space):
+def _PyPy_Initialize(space):
     srcdir = pypy.__file__
     # set pythonhome/virtualenv
     pyhome = None

File pypy/module/cpyext/src/pythonrun.c

 }
 
 void Py_Initialize(void) {
-
+#ifdef PYPY_STANDALONE   /* 1 or 0, but defined */
     char *errmsg = RPython_StartupCode();
     if (errmsg) {
         fprintf(stderr, "unable to initialize PyPy: %s\n", errmsg);
         abort();
         return;
     }
+#endif
 
-    PyPy_Initialize();
-
+    _PyPy_Initialize();
 }