mirror of
https://github.com/python/cpython.git
synced 2024-12-14 04:17:19 +08:00
GH-100530: Change the error message for non-class class patterns (GH-103576)
This commit is contained in:
parent
78cac520c3
commit
07804ce24c
@ -0,0 +1 @@
|
||||
Clarify the error message raised when the called part of a class pattern isn't actually a class.
|
@ -416,7 +416,7 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type,
|
||||
Py_ssize_t nargs, PyObject *kwargs)
|
||||
{
|
||||
if (!PyType_Check(type)) {
|
||||
const char *e = "called match pattern must be a type";
|
||||
const char *e = "called match pattern must be a class";
|
||||
_PyErr_Format(tstate, PyExc_TypeError, e);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user