Skip to content

Commit

Permalink
GH-100530: Change the error message for non-class class patterns (GH-…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored Apr 18, 2023
1 parent 78cac52 commit 07804ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify the error message raised when the called part of a class pattern isn't actually a class.
2 changes: 1 addition & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 07804ce

Please sign in to comment.