Author: Armin Rigo <ar...@tunes.org>
Branch: space-newtext
Changeset: r90090:5ed6992ffdcd
Date: 2017-02-13 16:08 +0100
http://bitbucket.org/pypy/pypy/changeset/5ed6992ffdcd/

Log:    fix on 32-bit

diff --git a/pypy/module/struct/formatiterator.py 
b/pypy/module/struct/formatiterator.py
--- a/pypy/module/struct/formatiterator.py
+++ b/pypy/module/struct/formatiterator.py
@@ -160,8 +160,11 @@
                 w_value = self.space.newint(intmask(value))
             else:
                 w_value = self.space.newint(value)
-        elif isinstance(value, r_longlong) and -maxint-1 <= value <= maxint:
-            w_value = self.space.newint(intmask(value))
+        elif isinstance(value, r_longlong):
+            if value == r_longlong(intmask(value)):
+                w_value = self.space.newint(intmask(value))
+            else:
+                w_value = self.space.newint(value)
         elif isinstance(value, int):
             w_value = self.space.newint(value)
         elif isinstance(value, float):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to