[pypy-svn] r50595 - pypy/branch/applevel-ctypes2/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Mon Jan 14 15:24:05 CET 2008


Author: arigo
Date: Mon Jan 14 15:23:58 2008
New Revision: 50595

Modified:
   pypy/branch/applevel-ctypes2/pypy/interpreter/baseobjspace.py
Log:
Translation fixes.


Modified: pypy/branch/applevel-ctypes2/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/branch/applevel-ctypes2/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/branch/applevel-ctypes2/pypy/interpreter/baseobjspace.py	Mon Jan 14 15:23:58 2008
@@ -99,9 +99,12 @@
         raise NotImplementedError
 
     def descr_call_mismatch(self, space, opname, RequiredClass, args):
+        if RequiredClass is None:
+            classname = '?'
+        else:
+            classname = wrappable_class_name(RequiredClass)
         msg = "'%s' object expected, got '%s' instead" % (
-            wrappable_class_name(RequiredClass),
-            self.getclass(space).getname(space, '?'))
+            classname, self.getclass(space).getname(space, '?'))
         raise OperationError(space.w_TypeError, space.wrap(msg))
 
     # used by _weakref implemenation
@@ -574,6 +577,7 @@
         Unwrap w_obj, checking that it is an instance of the required internal
         interpreter class (a subclass of Wrappable).
         """
+        assert RequiredClass is not None
         if can_be_None and self.is_w(w_obj, self.w_None):
             return None
         obj = self.interpclass_w(w_obj)



More information about the Pypy-commit mailing list