From c1ea05b925ae862ba4bd2d5b9d1c1457bcd05968 Mon Sep 17 00:00:00 2001 From: "roberto@freebsd64" Date: Sat, 14 May 2011 07:08:33 +0200 Subject: [PATCH] fixed profiler compilation in older python --- plugins/python/profiler.c | 2 +- plugins/python/uwsgi_python.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/python/profiler.c b/plugins/python/profiler.c index 20a9c7ff..abd7f79b 100644 --- a/plugins/python/profiler.c +++ b/plugins/python/profiler.c @@ -2,7 +2,7 @@ extern struct uwsgi_server uwsgi; -#ifndef PyFrame_GetLineNumber +#ifdef HAS_NOT_PyFrame_GetLineNumber int PyFrame_GetLineNumber(PyFrameObject *frame) { if (frame->f_trace) { return frame->f_lineno; diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h index e4ecdad0..4bc4c750 100644 --- a/plugins/python/uwsgi_python.h +++ b/plugins/python/uwsgi_python.h @@ -18,6 +18,10 @@ #define Py_ssize_t ssize_t #endif +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 7 +#define HAS_NOT_PyFrame_GetLineNumber +#endif + #if PY_MAJOR_VERSION > 2 #define PYTHREE #endif