-
-
Notifications
You must be signed in to change notification settings - Fork 456
Closed
Labels
Description
Describe the bug
In Python 3.11, the f_lasti
member of PyFrameObject will be removed.
AFAIK, the quickened interpreter uses a different strategy to track what it's executing; a byte offset into original bytecode would need to be computed from other data (and probably wouldn't make sense in some cases).
This is an early heads-up; you might want to be part of the conversation in CPython so a better API can be designed for coverage
's use case.
AFAICS, coverage uses f_lasti
for generators, but I'm not really sure what the code is actually doing. Should CPython add API for telling just-started generator apart from a resuming generator, for example?
To Reproduce
- What version of Python are you using? CPython 3.11.0a1+, main branch (
380c440875
) - What version of coverage.py are you using? master branch (
0eaeb99f2d
) - What versions of what packages do you have installed? Nothing extra;
pip freeze
output is empty - What commands did you run?
python3 setup.py build
...
coverage/ctracer/tracer.c: In function ‘CTracer_handle_call’:
coverage/ctracer/tracer.c:552:14: error: ‘PyFrameObject’ {aka ‘struct _frame’} has no member named ‘f_lasti’
552 | if (frame->f_lasti < 0) {
| ^~
In file included from coverage/ctracer/tracer.c:6:
coverage/ctracer/tracer.c: In function ‘CTracer_handle_return’:
coverage/ctracer/util.h:18:31: error: ‘PyFrameObject’ {aka ‘struct _frame’} has no member named ‘f_lasti’
18 | #define MyFrame_lasti(f) (f->f_lasti * 2)
| ^~
coverage/ctracer/tracer.c:719:25: note: in expansion of macro ‘MyFrame_lasti’
719 | int lasti = MyFrame_lasti(frame);
| ^~~~~~~~~~~~~
**
** Couldn't install with extension module, trying without it...
** BuildFailed: command '/usr/lib64/ccache/gcc' failed with exit code 1
**
Expected behavior
The extension compiles :)