Commit c26d2bff authored by Armin Rigo's avatar Armin Rigo

Use the more precise AnnotatorError in this new place

parent 3037cc62
......@@ -420,8 +420,8 @@ class ClassDesc(Desc):
baselist = list(cls.__bases__)
if cls.__dict__.get('_mixin_', False):
raise Exception("cannot use directly the class %r because it"
" is a _mixin_" % (cls,))
raise AnnotatorError("cannot use directly the class %r because "
"it is a _mixin_" % (cls,))
# special case: skip BaseException in Python 2.5, and pretend
# that all exceptions ultimately inherit from Exception instead
......@@ -2543,14 +2543,14 @@ class TestAnnotateTestCase:
def f():
return A()
a = self.RPythonAnnotator()
py.test.raises(Exception, a.build_types, f, [])
py.test.raises(annmodel.AnnotatorError, a.build_types, f, [])
class B(object):
x = B()
def g():
return isinstance(x, A)
py.test.raises(Exception, a.build_types, g, [])
py.test.raises(annmodel.AnnotatorError, a.build_types, g, [])
def test_import_from_mixin(self):
class M(object):
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment