[pypy-commit] pypy online-transforms: Handle method_descriptor case

rlamy noreply at buildbot.pypy.org
Thu Oct 23 11:16:21 CEST 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: online-transforms
Changeset: r74102:ee3b3b9274c1
Date: 2014-10-23 11:15 +0200
http://bitbucket.org/pypy/pypy/changeset/ee3b3b9274c1/

Log:	Handle method_descriptor case

diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -323,6 +323,10 @@
                     # unbound method
                     cls_s = self.annotationclass(x.im_class)
                     result = cls_s.find_unboundmethod(x.__name__)
+            elif hasattr(x, '__objclass__'):
+                # builtin unbound method on CPython (aka 'method_descriptor')
+                cls_s = self.annotationclass(x.__objclass__)
+                result = cls_s.find_unboundmethod(x.__name__)
             else:
                 result = None
             if result is None:


More information about the pypy-commit mailing list