mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
[3.14] gh-138479: Ensure that __typing_subst__ returns a tuple (GH-138482) (#138784)
Some checks are pending
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
Some checks are pending
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
440b83f838
commit
fbfbfdf33c
3 changed files with 31 additions and 0 deletions
|
|
@ -525,12 +525,24 @@ _Py_subs_parameters(PyObject *self, PyObject *args, PyObject *parameters, PyObje
|
|||
return NULL;
|
||||
}
|
||||
if (unpack) {
|
||||
if (!PyTuple_Check(arg)) {
|
||||
Py_DECREF(newargs);
|
||||
Py_DECREF(item);
|
||||
Py_XDECREF(tuple_args);
|
||||
PyObject *original = PyTuple_GET_ITEM(args, iarg);
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"expected __typing_subst__ of %T objects to return a tuple, not %T",
|
||||
original, arg);
|
||||
Py_DECREF(arg);
|
||||
return NULL;
|
||||
}
|
||||
jarg = tuple_extend(&newargs, jarg,
|
||||
&PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg));
|
||||
Py_DECREF(arg);
|
||||
if (jarg < 0) {
|
||||
Py_DECREF(item);
|
||||
Py_XDECREF(tuple_args);
|
||||
assert(newargs == NULL);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue