[pypy-commit] pypy default: Translation fix.

Armin Rigo noreply at buildbot.pypy.org
Sat Jun 4 07:26:27 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r44686:e63df4bf1568
Date: 2011-06-04 07:26 +0200
http://bitbucket.org/pypy/pypy/changeset/e63df4bf1568/

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