summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index a93ceea..4e08a2a 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2743,7 +2743,10 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
Py_DECREF(tmp);
}
- if (PyString_Check(type))
+ if (PyString_CheckExact(type))
+ /* Raising builtin string is deprecated but still allowed --
+ * do nothing. Raising an instance of a new-style str
+ * subclass is right out. */
;
else if (PyClass_Check(type))