Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r52683:83cf494c988c
Date: 2012-02-20 20:33 +0100
http://bitbucket.org/pypy/pypy/changeset/83cf494c988c/

Log:    we no longer have unbound methods in python2, so type(A.meth)
        returns the type of a function. Adapt to bound methods instead

diff --git a/pypy/interpreter/test/test_executioncontext.py 
b/pypy/interpreter/test/test_executioncontext.py
--- a/pypy/interpreter/test/test_executioncontext.py
+++ b/pypy/interpreter/test/test_executioncontext.py
@@ -108,9 +108,10 @@
             space.getexecutioncontext().setllprofile(None, None)
             assert l == ['call', 'return', 'call', 'c_call', 'c_return', 
'return']
             if isinstance(seen[0], Method):
+                w_class = space.type(seen[0].w_instance)
                 found = 'method %s of %s' % (
                     seen[0].w_function.name,
-                    seen[0].w_class.getname(space))
+                    w_class.getname(space))
             else:
                 assert isinstance(seen[0], Function)
                 found = 'builtin %s' % seen[0].name
@@ -196,8 +197,8 @@
                 self.value = value
             def meth(self):
                 pass
-        MethodType = type(A.meth)
-        strangemeth = MethodType(A, 42, int)
+        MethodType = type(A(0).meth)
+        strangemeth = MethodType(A, 42)
         l = []
         def profile(frame, event, arg):
             l.append(event)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to