diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-01 19:26:01 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-05-02 07:38:20 -0400 |
commit | 540da6d02dc6f5f1e81ccb3dcb73257f47eb8f90 (patch) | |
tree | 5086249db4fcd222d3245f444e0c0a47c6dffcc6 /coverage/ctracer/util.h | |
parent | c6ba56c68b2a3850f530cc1fdbf9856a90559a1f (diff) | |
download | python-coveragepy-git-540da6d02dc6f5f1e81ccb3dcb73257f47eb8f90.tar.gz |
refactor: remove unneeded Py2 C code
Diffstat (limited to 'coverage/ctracer/util.h')
-rw-r--r-- | coverage/ctracer/util.h | 20 |
1 files changed, 0 insertions, 20 deletions
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 |