[pypy-commit] lang-smalltalk default: (cfbolz, lwassermann): changed the version checker to test for 64bit images only on 64bit systems

lwassermann noreply at buildbot.pypy.org
Wed Mar 6 21:16:32 CET 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch: 
Changeset: r124:d6155cf750e0
Date: 2013-03-06 21:08 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/d6155cf750e0/

Log:	(cfbolz, lwassermann): changed the version checker to test for 64bit
	images only on 64bit systems

diff --git a/spyvm/squeakimage.py b/spyvm/squeakimage.py
--- a/spyvm/squeakimage.py
+++ b/spyvm/squeakimage.py
@@ -1,5 +1,6 @@
 import py
 import os
+import sys
 from spyvm import constants
 from spyvm import model
 from spyvm.tool.bitmanipulation import splitter
@@ -134,6 +135,10 @@
     0x00001969:         ImageVersion(6505,  True,  False, True,  True ),
     0x69190000:         ImageVersion(6505,  False, False, True,  True ),
     0x00000000000109A0: ImageVersion(68000, True,  True,  False, False),
+}
+
+if sys.maxint == 2 ** 63 - 1:
+    image_versions.update({
    -0x5ff6ff0000000000:
     # signed version of 0xA009010000000000: 
                         ImageVersion(68000, False, True,  False, False),
@@ -145,7 +150,7 @@
    -0x5cf6ff0000000000:
     # signed version of 0xA309010000000000: 
 			ImageVersion(68003, False, True,  True,  True ),
-}
+})
 
     
 def version(magic):
diff --git a/spyvm/test/test_squeakimage.py b/spyvm/test/test_squeakimage.py
--- a/spyvm/test/test_squeakimage.py
+++ b/spyvm/test/test_squeakimage.py
@@ -184,6 +184,9 @@
     assert r.stream.pos == len(image_2)
 
 def test_simple_image64():
+    import sys
+    if not sys.maxint == 2 ** 63 - 1:
+      py.test.skip("on 32 bit platforms, we can't need to check for 64 bit images")
     word_size = 8
     header_size = 16 * word_size
 


More information about the pypy-commit mailing list