Message347295
Currently, `test_pycfunction` picks a few built-in functions with various calling conventions to exercise all the relevant code paths:
for py_name, py_args, c_name, expected_frame_number in (
('gmtime', '', 'time_gmtime', 1), # METH_VARARGS
('len', '[]', 'builtin_len', 2), # METH_O
...
See: https://github.com/python/cpython/blob/2f19e82fbe98ce86bcd98a176328af2808b678e8/Lib/test/test_gdb.py#L851
These calling conventions are not a guaranteed part of the interface, and as such these tests are fragile (as we saw in GH-14311, when converting the time module to use Argument Clinic changed gmtime from METH_VARARGS to METH_FASTCALL). Per Victor's suggestion in GH-14330, I think we should expose a few test functions in the `testcapi` module as exemplars of their respective calling conventions and use those, rather than arbitrary builtins. |
|
Date |
User |
Action |
Args |
2019-07-04 20:29:24 | p-ganssle | set | recipients:
+ p-ganssle, vstinner |
2019-07-04 20:29:24 | p-ganssle | set | messageid: <1562272164.16.0.880170642341.issue37499@roundup.psfhosted.org> |
2019-07-04 20:29:24 | p-ganssle | link | issue37499 messages |
2019-07-04 20:29:23 | p-ganssle | create | |
|