bpo-42800: add audit hooks for f_code and tb_frame by lunixbochs · Pull Request #24182 · python/cpython

@lunixbochs

* Accessing the following attributes will now fire PEP 578 style
  audit hooks as ("object.__getattr__", obj, name):
  * PyTracebackObject: tb_frame
  * PyFrameObject: f_code
  * PyGenObject: gi_code, gi_frame
  * PyCoroObject: cr_code, cr_frame
  * PyAsyncGenObject: ag_code, ag_frame

* Document audit hooks for tb_frame, f_code, and __code__
* Add an AUDIT_READ attribute flag aliased to READ_RESTRICTED.
* Update obsolete RESTRICTED flag documentation.

zooba

zooba added a commit that referenced this pull request

May 3, 2021
Accessing the following attributes will now fire PEP 578 style audit hooks as (object.__getattr__, obj, name):
* PyTracebackObject: tb_frame
* PyFrameObject: f_code
* PyGenObject: gi_code, gi_frame
* PyCoroObject: cr_code, cr_frame
* PyAsyncGenObject: ag_code, ag_frame

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 3, 2021
Accessing the following attributes will now fire PEP 578 style audit hooks as (object.__getattr__, obj, name):
* PyTracebackObject: tb_frame
* PyFrameObject: f_code
* PyGenObject: gi_code, gi_frame
* PyCoroObject: cr_code, cr_frame
* PyAsyncGenObject: ag_code, ag_frame
(cherry picked from commit bb2f3ff)

Co-authored-by: Steve Dower <steve.dower@python.org>

miss-islington added a commit that referenced this pull request

May 3, 2021
Accessing the following attributes will now fire PEP 578 style audit hooks as (object.__getattr__, obj, name):
* PyTracebackObject: tb_frame
* PyFrameObject: f_code
* PyGenObject: gi_code, gi_frame
* PyCoroObject: cr_code, cr_frame
* PyAsyncGenObject: ag_code, ag_frame
(cherry picked from commit bb2f3ff)

Co-authored-by: Steve Dower <steve.dower@python.org>