[pypy-commit] lang-io default: pass first test for forwding a message without arguments

bivab noreply at buildbot.pypy.org
Tue Sep 27 16:14:34 CEST 2011


Author: David Schneider <david.schneider at picle.org>
Branch: 
Changeset: r49:59c883c71c04
Date: 2011-09-27 16:06 +0200
http://bitbucket.org/pypy/lang-io/changeset/59c883c71c04/

Log:	pass first test for forwding a message without arguments

diff --git a/io/model.py b/io/model.py
--- a/io/model.py
+++ b/io/model.py
@@ -239,8 +239,14 @@
             w_result = self.cached_result
         else:
             w_method = w_receiver.lookup(self.name)
-            assert w_method is not None, 'Method "%s" not found in "%s"' % (self.name, str(w_receiver))
-            w_result = w_method.apply(space, w_receiver, self, w_context)
+            if w_method is not None:
+                w_result = w_method.apply(space, w_receiver, self, w_context)
+            else:
+                w_forward = w_receiver.lookup('forward')
+                if w_forward:
+                    w_result = w_forward.apply(space, w_receiver, self, w_context)
+                else:
+                    raise AssertionError('Method "%s" not found in "%s"' % (self.name, str(w_receiver)))
             if not space.is_normal_status():
                 print 'Returning non default value'
                 return space.w_return_value


More information about the pypy-commit mailing list