[pypy-commit] pypy online-transforms: fix for _mixin_ methods

rlamy noreply at buildbot.pypy.org
Sun Nov 2 23:41:03 CET 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: online-transforms
Changeset: r74326:aa409f72647b
Date: 2014-10-30 17:04 +0000
http://bitbucket.org/pypy/pypy/changeset/aa409f72647b/

Log:	fix for _mixin_ methods

diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -12,7 +12,7 @@
     SomeBuiltin, SomePBC, SomeInteger, TLS, SomeUnicodeCodePoint,
     s_None, s_ImpossibleValue, SomeBool, SomeTuple,
     SomeImpossibleValue, SomeUnicodeString, SomeList, HarmlesslyBlocked,
-    SomeWeakRef, SomeByteArray, SomeConstantType)
+    SomeWeakRef, SomeByteArray, SomeConstantType, AnnotatorError)
 from rpython.annotator.classdef import InstanceSource, ClassDef
 from rpython.annotator.listdef import ListDef, ListItem
 from rpython.annotator.dictdef import DictDef
@@ -330,7 +330,10 @@
                     if hasattr(x.im_class, '_freeze_'):
                         return self.immutablevalue(x.im_func)
                     cls_s = self.annotationclass(x.im_class)
-                    result = cls_s.find_unboundmethod(x.im_func.__name__)
+                    if cls_s is None:
+                        result = None
+                    else:
+                        result = cls_s.find_unboundmethod(x.im_func.__name__)
             else:
                 result = None
             if result is None:
@@ -458,7 +461,10 @@
         try:
             return _cls2Some[cls]
         except KeyError:
-            return type(self.valueoftype(cls))
+            try:
+                return type(self.valueoftype(cls))
+            except AnnotatorError:
+                return None
 
     def get_classpbc_attr_families(self, attrname):
         """Return the UnionFind for the ClassAttrFamilies corresponding to


More information about the pypy-commit mailing list