[pypy-svn] r48941 - pypy/dist/pypy/lang/smalltalk

tverwaes at codespeak.net tverwaes at codespeak.net
Thu Nov 22 18:35:39 CET 2007


Author: tverwaes
Date: Thu Nov 22 18:35:39 2007
New Revision: 48941

Modified:
   pypy/dist/pypy/lang/smalltalk/model.py
   pypy/dist/pypy/lang/smalltalk/shadow.py
Log:
Contexts can not be created with basicNew -> raise


Modified: pypy/dist/pypy/lang/smalltalk/model.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/model.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/model.py	Thu Nov 22 18:35:39 2007
@@ -391,16 +391,13 @@
     def literalatput0(self, index0, w_value):
         if index0 == 0:
             from pypy.lang.smalltalk import utility
-            print "Going to save as header: %r" % w_value
             header = utility.unwrap_int(w_value)
             self.setheader(header)
         else:
             self.literals[index0-1] = w_value
 
     def at0(self, index0):
-        # XXX
         from pypy.lang.smalltalk import utility
-        print "TRYING TO GET: %d %d" % (self.getliteralsize(), index0)
         if index0 < self.getliteralsize():
             self.literalat0(index0)
         else:
@@ -409,7 +406,6 @@
         
     def atput0(self, index0, w_value):
         from pypy.lang.smalltalk import utility
-        print "TRYING TO SET: %d %d %r" % (self.getliteralsize(), index0, w_value)
         if index0 < self.getliteralsize():
             self.literalatput0(index0, w_value)
         else:

Modified: pypy/dist/pypy/lang/smalltalk/shadow.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/shadow.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/shadow.py	Thu Nov 22 18:35:39 2007
@@ -120,8 +120,8 @@
         if w_cls == classtable.w_BlockContext:
             return model.W_BlockContext(None, None, 0, 0)
         elif w_cls == classtable.w_MethodContext:
-            assert 0, "this seems nonsense"
-            return model.W_MethodContext(None, None, [], extrasize)
+            # From slang: Contexts must only be created with newForMethod:
+            raise error.PrimitiveFailedError
         
         if self.instance_kind == POINTERS:
             return model.W_PointersObject(w_cls, self.instance_size+extrasize)



More information about the Pypy-commit mailing list