diff options
author | Brandt Bucher <brandt@python.org> | 2021-04-06 02:17:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 02:17:08 (GMT) |
commit | f84d5a113680c5a6aaaf9130aed7a34d611748ff (patch) | |
tree | cde22e0e7ee970e49e10b6a5b137fe4f90d444f8 /Python | |
parent | 3d4af4a876e679431c6a3751667ded63cc6f66c1 (diff) | |
download | cpython-f84d5a113680c5a6aaaf9130aed7a34d611748ff.zip cpython-f84d5a113680c5a6aaaf9130aed7a34d611748ff.tar.gz cpython-f84d5a113680c5a6aaaf9130aed7a34d611748ff.tar.bz2 |
bpo-42128: __match_args__ can't be a list anymore (GH-25203)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index b9d784a..d9a754f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1029,15 +1029,8 @@ match_class(PyThreadState *tstate, PyObject *subject, PyObject *type, int match_self = 0; match_args = PyObject_GetAttrString(type, "__match_args__"); if (match_args) { - if (PyList_CheckExact(match_args)) { - Py_SETREF(match_args, PyList_AsTuple(match_args)); - } - if (match_args == NULL) { - goto fail; - } if (!PyTuple_CheckExact(match_args)) { - const char *e = "%s.__match_args__ must be a list or tuple " - "(got %s)"; + const char *e = "%s.__match_args__ must be a tuple (got %s)"; _PyErr_Format(tstate, PyExc_TypeError, e, ((PyTypeObject *)type)->tp_name, Py_TYPE(match_args)->tp_name); |