[pypy-svn] r20213 - pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Thu Nov 24 16:55:48 CET 2005


Author: arigo
Date: Thu Nov 24 16:55:47 2005
New Revision: 20213

Modified:
   pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py
Log:
(mwh, pedronis)

Fix assert in MethodOfFrozenPBCRepr.convert_const.  Two more tests pass in
test_rpbc.py.



Modified: pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py	Thu Nov 24 16:55:47 2005
@@ -141,8 +141,9 @@
         return r_func, 1
 
     def convert_const(self, method):
-        if getattr(method, 'im_func', None) is not self.function:
-            raise TyperError("not a method bound on %r: %r" % (self.function,
+        mdesc = self.rtyper.annotator.bookkeeper.getdesc(method)
+        if mdesc.funcdesc is not self.funcdesc:
+            raise TyperError("not a method bound on %r: %r" % (self.funcdesc,
                                                                method))
         return self.r_im_self.convert_const(method.im_self)
 



More information about the Pypy-commit mailing list