gh-107674: Lazy load line number to improve performance of tracing (GH-118127)

This commit is contained in:
Tian Gao 2024-04-29 01:54:52 -07:00 committed by GitHub
parent c7e7bfc4ca
commit 375c94c75d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 19 deletions

View file

@ -174,6 +174,7 @@ call_trace_func(_PyLegacyEventHandler *self, PyObject *arg)
Py_INCREF(frame);
int err = tstate->c_tracefunc(tstate->c_traceobj, frame, self->event, arg);
frame->f_lineno = 0;
Py_DECREF(frame);
if (err) {
return NULL;