python get line number/profier fix

This commit is contained in:
roberto@natty32
2011-05-05 02:40:53 +02:00
parent 991e818449
commit 56146a34af
+7 -2
View File
@@ -3,8 +3,13 @@
extern struct uwsgi_server uwsgi;
#ifndef PyFrame_GetLineNumber
static int PyFrame_GetLineNumber(PyFrameObject *frame) {
return frame->f_lineno;
int PyFrame_GetLineNumber(PyFrameObject *frame) {
if (frame->f_trace) {
return frame->f_lineno;
}
else {
return PyCode_Addr2Line(frame->f_code, frame->f_lasti);
}
}
#endif