mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	SF bug #699934: Obscure error message
mwh pointed out that the error message did not make sense if obtained by rearranging the bases.
This commit is contained in:
		
							parent
							
								
									ff41c48a77
								
							
						
					
					
						commit
						f394df47fd
					
				
					 2 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
					@ -1062,9 +1062,8 @@ class EditableScrollablePane(ScrollablePane,EditablePane): pass
 | 
				
			||||||
          (EditableScrollablePane, ScrollablePane, EditablePane,
 | 
					          (EditableScrollablePane, ScrollablePane, EditablePane,
 | 
				
			||||||
           Pane, ScrollingMixin, EditingMixin, object))
 | 
					           Pane, ScrollingMixin, EditingMixin, object))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mro_err_msg = """Cannot create class.The superclasses have conflicting
 | 
					mro_err_msg = """Cannot create a consistent method resolution
 | 
				
			||||||
inheritance trees which leave the method resolution order (MRO)
 | 
					order (MRO) for bases """
 | 
				
			||||||
undefined for bases """
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
def mro_disagreement():
 | 
					def mro_disagreement():
 | 
				
			||||||
    if verbose: print "Testing error messages for MRO disagreement..."
 | 
					    if verbose: print "Testing error messages for MRO disagreement..."
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1082,10 +1082,8 @@ set_mro_error(PyObject *to_merge, int *remain)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	n = PyDict_Size(set);
 | 
						n = PyDict_Size(set);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	off = PyOS_snprintf(buf, sizeof(buf), "Cannot create class.\
 | 
						off = PyOS_snprintf(buf, sizeof(buf), "Cannot create a \
 | 
				
			||||||
The superclasses have conflicting\n\
 | 
					consistent method resolution\norder (MRO) for bases");
 | 
				
			||||||
inheritance trees which leave the method resolution order (MRO)\n\
 | 
					 | 
				
			||||||
undefined for bases");
 | 
					 | 
				
			||||||
	i = 0;
 | 
						i = 0;
 | 
				
			||||||
	while (PyDict_Next(set, &i, &k, &v) && off < sizeof(buf)) {
 | 
						while (PyDict_Next(set, &i, &k, &v) && off < sizeof(buf)) {
 | 
				
			||||||
		PyObject *name = class_name(k);
 | 
							PyObject *name = class_name(k);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue