]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-100530: Change the error message for non-class class patterns (GH-103576)
authorNikita Sobolev <mail@sobolevn.me>
Tue, 18 Apr 2023 17:41:14 +0000 (20:41 +0300)
committerGitHub <noreply@github.com>
Tue, 18 Apr 2023 17:41:14 +0000 (10:41 -0700)
Misc/NEWS.d/next/Core and Builtins/2023-04-16-14-38-39.gh-issue-100530.OR6-sn.rst [new file with mode: 0644]
Python/ceval.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-04-16-14-38-39.gh-issue-100530.OR6-sn.rst b/Misc/NEWS.d/next/Core and Builtins/2023-04-16-14-38-39.gh-issue-100530.OR6-sn.rst
new file mode 100644 (file)
index 0000000..5b1bcc4
--- /dev/null
@@ -0,0 +1 @@
+Clarify the error message raised when the called part of a class pattern isn't actually a class.
index 8c43e3d89c2c2a9bc889372470e1fada2c573bfa..d8495da81e94ec949893ea889a41b075b94f777e 100644 (file)
@@ -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;
     }