[pypy-commit] lang-smalltalk default: enable to read (not support) cog-byte-reversal saved images (6505)

krono noreply at buildbot.pypy.org
Tue Feb 19 16:14:04 CET 2013


Author: Tobias Pape <tobias at netshed.de>
Branch: 
Changeset: r63:f8278cad1ec7
Date: 2013-02-19 16:13 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/f8278cad1ec7/

Log:	enable to read (not support) cog-byte-reversal saved images (6505)

diff --git a/spyvm/squeakimage.py b/spyvm/squeakimage.py
--- a/spyvm/squeakimage.py
+++ b/spyvm/squeakimage.py
@@ -69,9 +69,12 @@
 
 # ____________________________________________________________
 
+# XXX hack to read Cog images.
+# TODO implement Cog float byte reversal
+SUPPORTED_VERSIONS = [6502, 6505]
+
 class ImageReader(object):
     
-
     def __init__(self, space, stream):
         self.space = space
         self.stream = stream
@@ -94,10 +97,10 @@
     def read_header(self):
         # 1 word version
         version = self.stream.peek()
-        if version != 0x1966:
+        if version not in SUPPORTED_VERSIONS:
             self.stream.swap = True
             version = self.stream.peek()
-            if version != 0x1966:
+            if version not in SUPPORTED_VERSIONS:
                 raise CorruptImageError
         version = self.stream.next()
         #------


More information about the pypy-commit mailing list