STINNER Victor added the comment: > Depends on how you use it, I guess. In many cases (at least for Cython and > likely some other low-level tools), it could be as simple as > > #if PY_VERSION_HEX < 0x030400B2 > // set "f_tstate" here > #endif
Why would you set f_tstate field? Frame constructor (PyFrame_New) and Generators (gen_send_ex) do it for you. Cython does touch this field? Stackless Python supports Python 3 (3.4)? If something relies on f_tstate, it's easy to avoid this field. > Would it be correct for them to just use the current thread state instead? > E.g. from a signal handler that analysis the current threads? The faulthandler has different low-level C signal handlers and it doesn't use f_tstate, but PyGILState_GetThisThreadState() (or PyThreadState_Get() if thread support is disabled). I was surprised that it was so easy to modify ceval.c: in most cases, you already have the thread state. So I just passed the thread state to the function. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14432> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com