From: Tom Tromey Date: Tue, 21 Oct 2025 16:04:14 +0000 (-0600) Subject: Remove Py_TPFLAGS_CHECKTYPES X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f20c97f00d29d0a4459a0606164ceb192fe6432b;p=thirdparty%2Fbinutils-gdb.git Remove Py_TPFLAGS_CHECKTYPES According to 'git annotate', the Py_TPFLAGS_CHECKTYPES was added to python-internal.h way back when gdb was first ported to Python 3. It was a compatibility fix for Python 2. This is not needed any more, because Python 2 is no longer supported. This patch removes the vestiges. Approved-By: Simon Marchi --- diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 70dcb0c7ca2..c0784396009 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -2382,8 +2382,7 @@ PyTypeObject value_object_type = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES - | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ "GDB value object", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index e2baa6a70b5..54467ba49f3 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -90,8 +90,6 @@ static_assert (PY_VERSION_HEX >= 0x03040000); -#define Py_TPFLAGS_CHECKTYPES 0 - /* If Python.h does not define WITH_THREAD, then the various GIL-related functions will not be defined. However, PyGILState_STATE will be. */