[pypy-svn] rev 736 - in pypy/trunk/src/pypy: interpreter/test objspace/std

arigo at codespeak.net arigo at codespeak.net
Fri May 30 18:20:15 CEST 2003


Author: arigo
Date: Fri May 30 18:20:14 2003
New Revision: 736

Modified:
   pypy/trunk/src/pypy/interpreter/test/test_extmodule.py
   pypy/trunk/src/pypy/interpreter/test/test_interpreter.py
   pypy/trunk/src/pypy/objspace/std/multimethod.py
Log:
correct some space.call() and added a systematic check in multimethod.py

Modified: pypy/trunk/src/pypy/interpreter/test/test_extmodule.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/test/test_extmodule.py	(original)
+++ pypy/trunk/src/pypy/interpreter/test/test_extmodule.py	Fri May 30 18:20:14 2003
@@ -51,7 +51,7 @@
             {'__doc__': BM_with_appmethod.__doc__,
             '__name__': BM_with_appmethod.__pythonname__,
             'amethod': BM_with_appmethod.amethod} )
-        result = space.call(w_method, space.wrap(()), None)
+        result = space.call(w_method, space.wrap(()), space.wrap({}))
         self.assertEqual(result, 23)
 
     def test_appdata(self):

Modified: pypy/trunk/src/pypy/interpreter/test/test_interpreter.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/test/test_interpreter.py	(original)
+++ pypy/trunk/src/pypy/interpreter/test/test_interpreter.py	Fri May 30 18:20:14 2003
@@ -23,8 +23,9 @@
 
         wrappedargs = w(args)
         wrappedfunc = space.getitem(w_glob, w(functionname))
+        wrappedkwds = space.newdict([])
         try:
-            w_output = space.call(wrappedfunc, wrappedargs, None)
+            w_output = space.call(wrappedfunc, wrappedargs, wrappedkwds)
         except baseobjspace.OperationError, e:
             e.print_detailed_traceback(space)
             return '<<<%s>>>' % e.errorstr(space)

Modified: pypy/trunk/src/pypy/objspace/std/multimethod.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/multimethod.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/multimethod.py	Fri May 30 18:20:14 2003
@@ -56,6 +56,9 @@
                 delegators.update(getattr(nexttype, "delegate_once", {}))
                 # before general delegation, try superclasses
                 if not nexttype.__bases__:
+                    # debugging assertion
+                    assert nexttype.__name__ == 'W_Object',  \
+                    "calling a multimethod with an argument which is not wrapped"
                     break
                 nexttype, = nexttype.__bases__ # no multiple inheritance pleeease
             for othertype, delegator in delegators.items():


More information about the Pypy-commit mailing list