Author: Armin Rigo <[email protected]>
Branch:
Changeset: r72705:0dad266b2efa
Date: 2014-08-06 18:56 +0200
http://bitbucket.org/pypy/pypy/changeset/0dad266b2efa/
Log: Use the more precise AnnotatorError in this new place
diff --git a/rpython/annotator/description.py b/rpython/annotator/description.py
--- a/rpython/annotator/description.py
+++ b/rpython/annotator/description.py
@@ -420,8 +420,8 @@
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
diff --git a/rpython/annotator/test/test_annrpython.py
b/rpython/annotator/test/test_annrpython.py
--- a/rpython/annotator/test/test_annrpython.py
+++ b/rpython/annotator/test/test_annrpython.py
@@ -2543,14 +2543,14 @@
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):
pass
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):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit