Author: Amaury Forgeot d'Arc <[email protected]>
Branch: embedded-pypy
Changeset: r54186:e4568fc96f21
Date: 2012-04-05 00:33 +0200
http://bitbucket.org/pypy/pypy/changeset/e4568fc96f21/
Log: Fix cpyext tests, I hope I did not break Py_Initialize.
diff --git a/pypy/module/cpyext/pythonrun.py b/pypy/module/cpyext/pythonrun.py
--- a/pypy/module/cpyext/pythonrun.py
+++ b/pypy/module/cpyext/pythonrun.py
@@ -13,8 +13,8 @@
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)
@@ -27,7 +27,8 @@
@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)
@@ -79,7 +80,7 @@
''').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
diff --git a/pypy/module/cpyext/src/pythonrun.c
b/pypy/module/cpyext/src/pythonrun.c
--- a/pypy/module/cpyext/src/pythonrun.c
+++ b/pypy/module/cpyext/src/pythonrun.c
@@ -36,15 +36,15 @@
}
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();
}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit