Author: Matti Picus <[email protected]>
Branch: cpyext-int
Changeset: r67399:2027437ec5a6
Date: 2013-10-15 20:41 +0300
http://bitbucket.org/pypy/pypy/changeset/2027437ec5a6/
Log: fix test by returning a PyIntObject where needed
diff --git a/pypy/module/cpyext/intobject.py b/pypy/module/cpyext/intobject.py
--- a/pypy/module/cpyext/intobject.py
+++ b/pypy/module/cpyext/intobject.py
@@ -41,10 +41,10 @@
as defined in the system header files)."""
return sys.maxint
-@cpython_api([lltype.Signed], PyObject)
+@cpython_api([lltype.Signed], PyIntObject)
def PyInt_FromLong(space, ival):
"""Create a new integer object with a value of ival.
-
+
"""
return space.wrap(ival)
@@ -117,7 +117,7 @@
LONG_MAX = int(LONG_TEST - 1)
-@cpython_api([rffi.SIZE_T], PyObject)
+@cpython_api([rffi.SIZE_T], PyIntObject)
def PyInt_FromSize_t(space, ival):
"""Create a new integer object with a value of ival. If the value exceeds
LONG_MAX, a long integer object is returned.
@@ -126,7 +126,7 @@
return space.wrap(intmask(ival))
return space.wrap(ival)
-@cpython_api([Py_ssize_t], PyObject)
+@cpython_api([Py_ssize_t], PyIntObject)
def PyInt_FromSsize_t(space, ival):
"""Create a new integer object with a value of ival. If the value is larger
than LONG_MAX or smaller than LONG_MIN, a long integer object is
@@ -134,7 +134,7 @@
"""
return space.wrap(ival)
-@cpython_api([CONST_STRING, rffi.CCHARPP, rffi.INT_real], PyObject)
+@cpython_api([CONST_STRING, rffi.CCHARPP, rffi.INT_real], PyIntObject)
def PyInt_FromString(space, str, pend, base):
"""Return a new PyIntObject or PyLongObject based on the string
value in str, which is interpreted according to the radix in base. If
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit