[3.14] gh-91048: Reorder result tuple of parse_code_object (GH-134898) (#134956)

* gh-91048:  Reorder result tuple of parse_code_object (GH-134898)

Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.
(cherry picked from commit 8e8786f898)

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>

* Reorder asyncio

---------

Co-authored-by: László Kiss Kollár <kiss.kollar.laszlo@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-06-11 03:33:46 +02:00 committed by GitHub
parent 77c4b5d413
commit f303532857
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 42 deletions

View file

@ -1562,9 +1562,9 @@ parse_code_object(RemoteUnwinderObject *unwinder,
Py_INCREF(meta->func_name);
Py_INCREF(meta->file_name);
PyTuple_SET_ITEM(tuple, 0, meta->func_name);
PyTuple_SET_ITEM(tuple, 1, meta->file_name);
PyTuple_SET_ITEM(tuple, 2, lineno);
PyTuple_SET_ITEM(tuple, 0, meta->file_name);
PyTuple_SET_ITEM(tuple, 1, lineno);
PyTuple_SET_ITEM(tuple, 2, meta->func_name);
*result = tuple;
return 0;
@ -2921,4 +2921,4 @@ PyMODINIT_FUNC
PyInit__remote_debugging(void)
{
return PyModuleDef_Init(&remote_debugging_module);
}
}