Skip to content

Commit

Permalink
fixed profiler compilation in older python
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto@freebsd64 committed May 14, 2011
1 parent 9435693 commit c1ea05b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/python/profiler.c
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions plugins/python/uwsgi_python.h
Expand Up @@ -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
Expand Down

0 comments on commit c1ea05b

Please sign in to comment.