[pypy-svn] r48147 - in pypy/dist/pypy/lang/smalltalk: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Oct 29 12:20:44 CET 2007


Author: cfbolz
Date: Mon Oct 29 12:20:43 2007
New Revision: 48147

Modified:
   pypy/dist/pypy/lang/smalltalk/model.py
   pypy/dist/pypy/lang/smalltalk/test/test_model.py
Log:
use consistent interface for the various setbyte versions. Why 
aren't those all returning characters?


Modified: pypy/dist/pypy/lang/smalltalk/model.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/model.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/model.py	Mon Oct 29 12:20:43 2007
@@ -366,9 +366,10 @@
             # of memory as smalltalk expects but wrapped in py-os
             raise NotImplementedError()
         else:
-            self.setbyte(index0, chr(unwrap_int(w_value)))
+            self.setbyte(index0, unwrap_int(w_value))
 
-    def setbyte(self, index0, character):
+    def setbyte(self, index0, byte):
+        character = chr(byte)
         self.bytes = (self.bytes[:index0] + character +
                       self.bytes[index0 + 1:])
 

Modified: pypy/dist/pypy/lang/smalltalk/test/test_model.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_model.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_model.py	Mon Oct 29 12:20:43 2007
@@ -72,7 +72,7 @@
 
 def test_w_compiledin():
     w_method = model.W_CompiledMethod(0, "abc")
-    w_method.setbyte(0, "c")
+    w_method.setbyte(0, ord("c"))
     assert w_method.bytes == "cbc"
 
 def test_hashes():



More information about the Pypy-commit mailing list