[pypy-commit] pypy arm-backend-2: Translation fix.
arigo
noreply at buildbot.pypy.org
Fri Jul 1 16:16:03 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: arm-backend-2
Changeset: r45232:9b56c79751ff
Date: 2011-06-04 07:26 +0200
http://bitbucket.org/pypy/pypy/changeset/9b56c79751ff/
Log: Translation fix.
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
@@ -73,12 +73,14 @@
space.wrap("an integer is required, got NULL"))
return space.int_w(w_obj) # XXX this is wrong on win64
+LONG_MAX = int(LONG_TEST - 1)
+
@cpython_api([rffi.SIZE_T], PyObject)
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.
"""
- if ival < LONG_TEST:
+ if ival <= LONG_MAX:
return space.wrap(intmask(ival))
return space.wrap(ival)
More information about the pypy-commit
mailing list