From 540da6d02dc6f5f1e81ccb3dcb73257f47eb8f90 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 1 May 2021 19:26:01 -0400 Subject: refactor: remove unneeded Py2 C code --- coverage/ctracer/util.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'coverage/ctracer/util.h') diff --git a/coverage/ctracer/util.h b/coverage/ctracer/util.h index 420b1cbb..adb36d5d 100644 --- a/coverage/ctracer/util.h +++ b/coverage/ctracer/util.h @@ -12,10 +12,6 @@ #undef COLLECT_STATS /* Collect counters: stats are printed when tracer is stopped. */ #undef DO_NOTHING /* Define this to make the tracer do nothing. */ -/* Py 2.x and 3.x compatibility */ - -#if PY_MAJOR_VERSION >= 3 - #define MyText_Type PyUnicode_Type #define MyText_AS_BYTES(o) PyUnicode_AsASCIIString(o) #define MyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) @@ -28,22 +24,6 @@ #define MyType_HEAD_INIT PyVarObject_HEAD_INIT(NULL, 0) -#else - -#define MyText_Type PyString_Type -#define MyText_AS_BYTES(o) (Py_INCREF(o), o) -#define MyBytes_GET_SIZE(o) PyString_GET_SIZE(o) -#define MyBytes_AS_STRING(o) PyString_AS_STRING(o) -#define MyText_AsString(o) PyString_AsString(o) -#define MyText_FromFormat PyUnicode_FromFormat -#define MyInt_FromInt(i) PyInt_FromLong((long)i) -#define MyInt_AsInt(o) (int)PyInt_AsLong(o) -#define MyText_InternFromString(s) PyString_InternFromString(s) - -#define MyType_HEAD_INIT PyObject_HEAD_INIT(NULL) 0, - -#endif /* Py3k */ - // The f_lasti field changed meaning in 3.10.0a7. It had been bytes, but // now is instructions, so we need to adjust it to use it as a byte index. #if PY_VERSION_HEX >= 0x030A00A7 -- cgit v1.2.1