From: Martin v. Löwis Date: Tue, 23 Jan 2007 21:11:47 +0000 (+0000) Subject: Make PyTraceBack_Here use the current thread, not the X-Git-Tag: v2.6a1~2235 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c5c502b914261ba333e98c4657a8d90cfbbe872;p=python Make PyTraceBack_Here use the current thread, not the frame's thread state. Fixes #1579370. Will backport. --- diff --git a/Misc/NEWS b/Misc/NEWS index 5c3f48df7b..65b0672c5a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 1? Core and builtins ----------------- +- Bug #1579370: Make PyTraceBack_Here use the current thread, not the + frame's thread state. + - patch #1630975: Fix crash when replacing sys.stdout in sitecustomize.py - Patch #1507247: tarfile.py: use current umask for intermediate diff --git a/Python/traceback.c b/Python/traceback.c index cfbd83361f..4ddee2c73b 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -113,7 +113,7 @@ newtracebackobject(PyTracebackObject *next, PyFrameObject *frame) int PyTraceBack_Here(PyFrameObject *frame) { - PyThreadState *tstate = frame->f_tstate; + PyThreadState *tstate = PyThreadState_GET(); PyTracebackObject *oldtb = (PyTracebackObject *) tstate->curexc_traceback; PyTracebackObject *tb = newtracebackobject(oldtb, frame); if (tb == NULL)