diff Python/ceval.c @ 59420:317d0c43ab2b legacy-trunk

more specific exception for wrong kind of raise #8082
author Benjamin Peterson <benjamin@python.org>
date Sun, 07 Mar 2010 00:00:37 +0000
parents dd2230a8c41d
children db961ba37cfe
line wrap: on
line diff
--- a/Python/ceval.c	Sat Mar 06 22:44:07 2010 +0000
+++ b/Python/ceval.c	Sun Mar 07 00:00:37 2010 +0000
@@ -3539,8 +3539,9 @@
 		/* Not something you can raise.  You get an exception
 		   anyway, just not what you specified :-) */
 		PyErr_Format(PyExc_TypeError,
-			"exceptions must be classes or instances, not %s",
-			type->ob_type->tp_name);
+			     "exceptions must be old-style classes or "
+			     "derived from BaseException, not %s",
+			     type->ob_type->tp_name);
 		goto raise_error;
 	}