Ned Batchelder <n...@nedbatchelder.com> added the comment:

I went ahead and changed the coverage.py code to this:

#if PY_VERSION_HEX >= 0x030B00A0
// 3.11 moved f_lasti into an internal structure. This is totally the wrong way
// to make this work, but it's all I've got until 
https://bugs.python.org/issue40421
// is resolved.
#include <internal/pycore_frame.h>
#define MyFrame_lasti(f)    ((f)->f_frame->f_lasti * 2)
#elif PY_VERSION_HEX >= 0x030A00A7
// The f_lasti field changed meaning in 3.10.0a7. It had been bytes, but
// now is instructions, so we need to adjust it to use it as a byte index.
#define MyFrame_lasti(f)    ((f)->f_lasti * 2)
#else
#define MyFrame_lasti(f)    ((f)->f_lasti)
#endif


If we had an API that let me distinguish between call and resume and between 
return and yield, I could get rid of this.

----------
nosy: +nedbat

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40421>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to