[pypy-svn] r73897 - in pypy/branch/cpython-extension: lib-python/modified-2.5.2/distutils pypy/module/cpyext
agaynor at codespeak.net
agaynor at codespeak.net
Tue Apr 20 09:07:42 CEST 2010
Author: agaynor
Date: Tue Apr 20 09:07:41 2010
New Revision: 73897
Modified:
pypy/branch/cpython-extension/lib-python/modified-2.5.2/distutils/sysconfig_pypy.py
pypy/branch/cpython-extension/pypy/module/cpyext/listobject.py
Log:
Implement some error checking I forgot.
Modified: pypy/branch/cpython-extension/lib-python/modified-2.5.2/distutils/sysconfig_pypy.py
==============================================================================
--- pypy/branch/cpython-extension/lib-python/modified-2.5.2/distutils/sysconfig_pypy.py (original)
+++ pypy/branch/cpython-extension/lib-python/modified-2.5.2/distutils/sysconfig_pypy.py Tue Apr 20 09:07:41 2010
@@ -7,15 +7,18 @@
from distutils.errors import DistutilsPlatformError
-PYPY_PREFIX = os.path.normpath(sys.pypy_prefix)
+if hasattr(sys, "pypy_prefix"):
+ PYPY_PREFIX = os.path.normpath(sys.pypy_prefix)
+else:
+ PYPY_PREFIX = "/home/alex/projects/pypy-cpy/"
python_build = False
def get_python_inc(plat_specific=0, prefix=None):
from os.path import join as j
if plat_specific:
- return j(sys.pypy_prefix, "pypy", "_interfaces")
- return j(sys.pypy_prefix, 'pypy', 'module', 'cpyext', 'include')
+ return j(PYPY_PREFIX, "pypy", "_interfaces")
+ return j(PYPY_PREFIX, 'pypy', 'module', 'cpyext', 'include')
def get_python_version():
"""Return a string containing the major and minor Python version,
Modified: pypy/branch/cpython-extension/pypy/module/cpyext/listobject.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/listobject.py (original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/listobject.py Tue Apr 20 09:07:41 2010
@@ -88,6 +88,8 @@
def PyList_Sort(space, w_list):
"""Sort the items of list in place. Return 0 on success, -1 on
failure. This is equivalent to list.sort()."""
+ if not isinstance(w_list, W_ListObject):
+ PyErr_BadInternalCall(space)
space.call_method(w_list, "sort")
return 0
@@ -95,6 +97,8 @@
def PyList_Reverse(space, w_list):
"""Reverse the items of list in place. Return 0 on success, -1 on
failure. This is the equivalent of list.reverse()."""
+ if not isinstance(w_list, W_ListObject):
+ PyErr_BadInternalCall(space)
space.call_method(w_list, "reverse")
return 0
More information about the Pypy-commit
mailing list