(EditableScrollablePane, ScrollablePane, EditablePane,
Pane, ScrollingMixin, EditingMixin, object))
+mro_err_msg = """Cannot create class.The superclasses have conflicting
+inheritance trees which leave the method resolution order (MRO)
+undefined for bases """
+
def mro_disagreement():
if verbose: print "Testing error messages for MRO disagreement..."
def raises(exc, expected, callable, *args):
# Test some very simple errors
raises(TypeError, "duplicate base class A",
type, "X", (A, A), {})
- raises(TypeError, "MRO conflict among bases ",
+ raises(TypeError, mro_err_msg,
type, "X", (A, B), {})
- raises(TypeError, "MRO conflict among bases ",
+ raises(TypeError, mro_err_msg,
type, "X", (A, C, B), {})
# Test a slightly more complex error
class GridLayout(object): pass
class VerticalGrid(GridLayout): pass
class HVGrid(HorizontalGrid, VerticalGrid): pass
class VHGrid(VerticalGrid, HorizontalGrid): pass
- raises(TypeError, "MRO conflict among bases ",
+ raises(TypeError, mro_err_msg,
type, "ConfusedGrid", (HVGrid, VHGrid), {})
def objects():
}
n = PyDict_Size(set);
- off = PyOS_snprintf(buf, sizeof(buf), "MRO conflict among bases");
+ off = PyOS_snprintf(buf, sizeof(buf), "Cannot create class.\
+The superclasses have conflicting\n\
+inheritance trees which leave the method resolution order (MRO)\n\
+undefined for bases");
i = 0;
while (PyDict_Next(set, &i, &k, &v) && off < sizeof(buf)) {
PyObject *name = class_name(k);