Skip to content

Commit 07804ce

Browse files
authored
GH-100530: Change the error message for non-class class patterns (GH-103576)
1 parent 78cac52 commit 07804ce

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify the error message raised when the called part of a class pattern isn't actually a class.

Python/ceval.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type,
416416
Py_ssize_t nargs, PyObject *kwargs)
417417
{
418418
if (!PyType_Check(type)) {
419-
const char *e = "called match pattern must be a type";
419+
const char *e = "called match pattern must be a class";
420420
_PyErr_Format(tstate, PyExc_TypeError, e);
421421
return NULL;
422422
}

0 commit comments

Comments
 (0)