Amaury Forgeot d'Arc avatar Amaury Forgeot d'Arc committed e4568fc

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

Comments (0)

Files changed (2)

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

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();
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.