]> granicus.if.org Git - python/commitdiff
Make PyTraceBack_Here use the current thread, not the
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 23 Jan 2007 21:11:58 +0000 (21:11 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 23 Jan 2007 21:11:58 +0000 (21:11 +0000)
frame's thread state. Fixes #1579370.

Misc/NEWS
Python/traceback.c

index f30f50b6a5584039c13bc7b706b09cb7f859d124..fc5dd66f0dc3910a8574b654871c69ab1f3449c9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 2.5.1c1?
 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
 
 - Bug #1637022: Prefix AST symbols with _Py_.
index cfbd83361fa74453b5d522f94f6f744ad49f9180..4ddee2c73b99fe5d83a594ccc36a088c9eb56499 100644 (file)
@@ -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)