From 23683ef26d19581a61594c76a45af014c1ff7b13 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 4 Jan 2011 00:00:31 +0000 Subject: Issue #10333: Remove ancient GC API, which has been deprecated since Python 2.2. --- Include/objimpl.h | 12 ------------ Misc/NEWS | 6 ++++++ Modules/gcmodule.c | 8 -------- Modules/pyexpat.c | 2 +- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Include/objimpl.h b/Include/objimpl.h index 3fef376..8fc3fc1 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -242,9 +242,6 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t); #define PyObject_GC_Resize(type, op, n) \ ( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) ) -/* for source compatibility with 2.2 */ -#define _PyObject_GC_Del PyObject_GC_Del - /* GC information is stored BEFORE the object structure. */ #ifndef Py_LIMITED_API typedef union _gc_head { @@ -328,15 +325,6 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); } \ } while (0) -/* This is here for the sake of backwards compatibility. Extensions that - * use the old GC API will still compile but the objects will not be - * tracked by the GC. */ -#define PyGC_HEAD_SIZE 0 -#define PyObject_GC_Init(op) -#define PyObject_GC_Fini(op) -#define PyObject_AS_GC(op) (op) -#define PyObject_FROM_GC(op) (op) - /* Test if a type supports weak references */ #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) diff --git a/Misc/NEWS b/Misc/NEWS index e9ba096..5df832d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -101,6 +101,12 @@ Library - Deprecated assertDictContainsSubset() in the unittest module. +C-API +----- + +- Issue #10333: Remove ancient GC API, which has been deprecated since + Python 2.2. + Build ----- diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 432efb3..10a4ed7 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1511,11 +1511,3 @@ PyObject_GC_Del(void *op) } PyObject_FREE(g); } - -/* for binary compatibility with 2.2 */ -#undef _PyObject_GC_Del -void -_PyObject_GC_Del(PyObject *op) -{ - PyObject_GC_Del(op); -} diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 1a00347..c83639c 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1522,7 +1522,7 @@ PyDoc_STRVAR(Xmlparsetype__doc__, "XML parser"); static PyTypeObject Xmlparsetype = { PyVarObject_HEAD_INIT(NULL, 0) "pyexpat.xmlparser", /*tp_name*/ - sizeof(xmlparseobject) + PyGC_HEAD_SIZE,/*tp_basicsize*/ + sizeof(xmlparseobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)xmlparse_dealloc, /*tp_dealloc*/ -- cgit v0.12