Issue #20315: Removed support for backward compatibility with early 2.x versions.

This commit is contained in:
Serhiy Storchaka 2014-01-20 21:29:31 +02:00
parent 6c01e38677
commit 7e52705ee3
6 changed files with 3 additions and 93 deletions

View file

@ -455,7 +455,6 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what,
PyTrace_RETURN event will be generated, so we don't need to
handle it. */
#ifdef PyTrace_C_CALL /* not defined in Python <= 2.3 */
/* the Python function 'frame' is issuing a call to the built-in
function 'arg' */
case PyTrace_C_CALL:
@ -477,7 +476,6 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what,
((PyCFunctionObject *)arg)->m_ml);
}
break;
#endif
default:
break;
@ -667,13 +665,7 @@ setBuiltins(ProfilerObject *pObj, int nvalue)
if (nvalue == 0)
pObj->flags &= ~POF_BUILTINS;
else if (nvalue > 0) {
#ifndef PyTrace_C_CALL
PyErr_SetString(PyExc_ValueError,
"builtins=True requires Python >= 2.4");
return -1;
#else
pObj->flags |= POF_BUILTINS;
#endif
}
return 0;
}
@ -771,11 +763,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
PyObject *timer = NULL;
double timeunit = 0.0;
int subcalls = 1;
#ifdef PyTrace_C_CALL
int builtins = 1;
#else
int builtins = 0;
#endif
static char *kwlist[] = {"timer", "timeunit",
"subcalls", "builtins", 0};

View file

@ -33,20 +33,6 @@ Copyright (C) 1994 Steen Lumholt.
#include <windows.h>
#endif
/* Allow using this code in Python 2.[12] */
#ifndef PyDoc_STRVAR
#define PyDoc_STRVAR(name,str) static char name[] = str
#endif
#ifndef PyMODINIT_FUNC
#define PyMODINIT_FUNC void
#endif
#ifndef PyBool_Check
#define PyBool_Check(o) 0
#define PyBool_FromLong PyLong_FromLong
#endif
#define CHECK_SIZE(size, elemsize) \
((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))

View file

@ -1534,13 +1534,6 @@ PyObject_GC_Track(void *op)
_PyObject_GC_TRACK(op);
}
/* for binary compatibility with 2.2 */
void
_PyObject_GC_Track(PyObject *op)
{
PyObject_GC_Track(op);
}
void
PyObject_GC_UnTrack(void *op)
{
@ -1551,13 +1544,6 @@ PyObject_GC_UnTrack(void *op)
_PyObject_GC_UNTRACK(op);
}
/* for binary compatibility with 2.2 */
void
_PyObject_GC_UnTrack(PyObject *op)
{
PyObject_GC_UnTrack(op);
}
PyObject *
_PyObject_GC_Malloc(size_t basicsize)
{