Python2 was deprecated 4 years ago, remove support and workarounds.
Showing the changes to tools/perf/scripts/python (1 of 3 files). Show all
Unified · Split
| @@ -24,16 +24,6 @@ · 23 unmodified lines | |||
| 24 | #include "../../../util/srcline.h" | 24 | #include "../../../util/srcline.h" |
| 25 | #include "../../../util/srccode.h" | 25 | #include "../../../util/srccode.h" |
| 26 | 26 | ||
| 27 | #if PY_MAJOR_VERSION < 3 | ||
| 28 | #define _PyCapsule_GetPointer(arg1, arg2) \ | ||
| 29 | PyCObject_AsVoidPtr(arg1) | ||
| 30 | #define _PyBytes_FromStringAndSize(arg1, arg2) \ | ||
| 31 | PyString_FromStringAndSize((arg1), (arg2)) | ||
| 32 | #define _PyUnicode_AsUTF8(arg) \ | ||
| 33 | PyString_AsString(arg) | ||
| 34 | |||
| 35 | PyMODINIT_FUNC initperf_trace_context(void); | ||
| 36 | #else | ||
| 37 | #define _PyCapsule_GetPointer(arg1, arg2) \ | 27 | #define _PyCapsule_GetPointer(arg1, arg2) \ |
| 38 | PyCapsule_GetPointer((arg1), (arg2)) | 28 | PyCapsule_GetPointer((arg1), (arg2)) |
| 39 | #define _PyBytes_FromStringAndSize(arg1, arg2) \ | 29 | #define _PyBytes_FromStringAndSize(arg1, arg2) \ |
| @@ -42,7 +32,6 @@ PyMODINIT_FUNC initperf_trace_context(void); · 2 unmodified lines | |||
| 42 | PyUnicode_AsUTF8(arg) | 32 | PyUnicode_AsUTF8(arg) |
| 43 | 33 | ||
| 44 | PyMODINIT_FUNC PyInit_perf_trace_context(void); | 34 | PyMODINIT_FUNC PyInit_perf_trace_context(void); |
| 45 | #endif | ||
| 46 | 35 | ||
| 47 | static struct scripting_context *get_args(PyObject *args, const char *name, PyObject **arg2) | 36 | static struct scripting_context *get_args(PyObject *args, const char *name, PyObject **arg2) |
| 48 | { | 37 | { |
| @@ -213,12 +202,6 @@ static PyMethodDef ContextMethods[] = { · 164 unmodified lines | |||
| 213 | { NULL, NULL, 0, NULL} | 202 | { NULL, NULL, 0, NULL} |
| 214 | }; | 203 | }; |
| 215 | 204 | ||
| 216 | #if PY_MAJOR_VERSION < 3 | ||
| 217 | PyMODINIT_FUNC initperf_trace_context(void) | ||
| 218 | { | ||
| 219 | (void) Py_InitModule("perf_trace_context", ContextMethods); | ||
| 220 | } | ||
| 221 | #else | ||
| 222 | PyMODINIT_FUNC PyInit_perf_trace_context(void) | 205 | PyMODINIT_FUNC PyInit_perf_trace_context(void) |
| 223 | { | 206 | { |
| 224 | static struct PyModuleDef moduledef = { | 207 | static struct PyModuleDef moduledef = { |
| @@ -240,4 +223,3 @@ PyMODINIT_FUNC PyInit_perf_trace_context(void) · 15 unmodified lines | |||
| 240 | 223 | ||
| 241 | return mod; | 224 | return mod; |
| 242 | } | 225 | } |
| 243 | #endif | ||