8000 bpo-41559: Convert lists to tuples in genericalias to prepare for PEP 612 by Fidget-Spinner · Pull Request #24056 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-41559: Convert lists to tuples in genericalias to prepare for PEP 612 #24056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Add recursion guards
  • Loading branch information
Fidget-Spinner committed Jan 10, 2021
commit e58597f0ef1e22ca120973c8bbf916848730691c
6 changes: 6 additions & 0 deletions Objects/genericaliasobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,15 @@ tupleify_lists(PyObject *args) {
goto error;
}
if (is_list) {
// Discard old arg since AsTuple gives a new reference.
Py_DECREF(arg);
}
if (Py_EnterRecursiveCall(" while converting lists to tuples in "
"GenericAlias' __args__")) {
goto error;
}
PyObject *new_arg_tupled = tupleify_lists(new_arg);
Py_LeaveRecursiveCall();
if (new_arg_tupled == NULL) {
Py_DECREF(new_arg);
goto error;
Expand Down
0