Mercurial > cpython-lru_cache-weakref
comparison Python/traceback.c @ 40703:df294bc5ce6e legacy-trunk
Make PyTraceBack_Here use the current thread, not the
frame's thread state. Fixes #1579370.
Will backport.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Tue, 23 Jan 2007 21:11:47 +0000 |
| parents | 7b2e436a4a21 |
| children | 6620a510e9a9 |
comparison
equal
deleted
inserted
replaced
| 40700:d2e2edd07082 | 40703:df294bc5ce6e |
|---|---|
| 111 } | 111 } |
| 112 | 112 |
| 113 int | 113 int |
| 114 PyTraceBack_Here(PyFrameObject *frame) | 114 PyTraceBack_Here(PyFrameObject *frame) |
| 115 { | 115 { |
| 116 PyThreadState *tstate = frame->f_tstate; | 116 PyThreadState *tstate = PyThreadState_GET(); |
| 117 PyTracebackObject *oldtb = (PyTracebackObject *) tstate->curexc_traceback; | 117 PyTracebackObject *oldtb = (PyTracebackObject *) tstate->curexc_traceback; |
| 118 PyTracebackObject *tb = newtracebackobject(oldtb, frame); | 118 PyTracebackObject *tb = newtracebackobject(oldtb, frame); |
| 119 if (tb == NULL) | 119 if (tb == NULL) |
| 120 return -1; | 120 return -1; |
| 121 tstate->curexc_traceback = (PyObject *)tb; | 121 tstate->curexc_traceback = (PyObject *)tb; |
