Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 23156:aae814f94bad legacy-trunk
ceval.c/do_raise(): Tighten the test to disallow raising an instance of
a str subclass.
test_descr.py/string_exceptions(): New sub-test.
For 2.3 only. Guido doesn't want this backported.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 18 Apr 2002 18:06:20 +0000 |
| parents | 830c829a7eb2 |
| children | 73249abed683 |
line wrap: on
line diff
--- a/Python/ceval.c Thu Apr 18 16:26:40 2002 +0000 +++ b/Python/ceval.c Thu Apr 18 18:06:20 2002 +0000 @@ -2743,7 +2743,10 @@ 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))
