Skip to content

Commit 23683ef

Browse files
committed
Issue #10333: Remove ancient GC API, which has been deprecated since
Python 2.2.
1 parent cae969e commit 23683ef

4 files changed

Lines changed: 7 additions & 21 deletions

File tree

Include/objimpl.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
242242
#define PyObject_GC_Resize(type, op, n) \
243243
( (type *) _PyObject_GC_Resize((PyVarObject *)(op), (n)) )
244244

245-
/* for source compatibility with 2.2 */
246-
#define _PyObject_GC_Del PyObject_GC_Del
247-
248245
/* GC information is stored BEFORE the object structure. */
249246
#ifndef Py_LIMITED_API
250247
typedef union _gc_head {
@@ -328,15 +325,6 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *);
328325
} \
329326
} while (0)
330327

331-
/* This is here for the sake of backwards compatibility. Extensions that
332-
* use the old GC API will still compile but the objects will not be
333-
* tracked by the GC. */
334-
#define PyGC_HEAD_SIZE 0
335-
#define PyObject_GC_Init(op)
336-
#define PyObject_GC_Fini(op)
337-
#define PyObject_AS_GC(op) (op)
338-
#define PyObject_FROM_GC(op) (op)
339-
340328

341329
/* Test if a type supports weak references */
342330
#define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ Library
101101

102102
- Deprecated assertDictContainsSubset() in the unittest module.
103103

104+
C-API
105+
-----
106+
107+
- Issue #10333: Remove ancient GC API, which has been deprecated since
108+
Python 2.2.
109+
104110
Build
105111
-----
106112

Modules/gcmodule.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,11 +1511,3 @@ PyObject_GC_Del(void *op)
15111511
}
15121512
PyObject_FREE(g);
15131513
}
1514-
1515-
/* for binary compatibility with 2.2 */
1516-
#undef _PyObject_GC_Del
1517-
void
1518-
_PyObject_GC_Del(PyObject *op)
1519-
{
1520-
PyObject_GC_Del(op);
1521-
}

Modules/pyexpat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ PyDoc_STRVAR(Xmlparsetype__doc__, "XML parser");
15221522
static PyTypeObject Xmlparsetype = {
15231523
PyVarObject_HEAD_INIT(NULL, 0)
15241524
"pyexpat.xmlparser", /*tp_name*/
1525-
sizeof(xmlparseobject) + PyGC_HEAD_SIZE,/*tp_basicsize*/
1525+
sizeof(xmlparseobject), /*tp_basicsize*/
15261526
0, /*tp_itemsize*/
15271527
/* methods */
15281528
(destructor)xmlparse_dealloc, /*tp_dealloc*/

0 commit comments

Comments
 (0)