chiark / gitweb /
_u32: Allow LONG_MAX to be stored in a Python int.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 22 Mar 2006 13:00:22 +0000 (13:00 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 22 Mar 2006 13:00:22 +0000 (13:00 +0000)
utils.pyx

index 6b62989..849effe 100644 (file)
--- a/utils.pyx
+++ b/utils.pyx
@@ -26,7 +26,7 @@
 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 cdef object _u32(uint32 x):
-  if x < LONG_MAX:
+  if x <= LONG_MAX:
     return PyInt_FromLong(x)
   else:
     return PyLong_FromUnsignedLong(x)