]> granicus.if.org Git - python/commitdiff
more specific exception for wrong kind of raise #8082
authorBenjamin Peterson <benjamin@python.org>
Sun, 7 Mar 2010 00:00:37 +0000 (00:00 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 7 Mar 2010 00:00:37 +0000 (00:00 +0000)
Python/ceval.c

index 7c1f7816e8ec00fcf358769cbad5efe233f56d19..1aa87a8d94231506f1b3077baffbf7be4f188aff 100644 (file)
@@ -3539,8 +3539,9 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
                /* 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;
        }