Skip to content

Commit 8d85624

Browse files
Remove c-versions of _pointer_type_cache/_ctypes_ptrtype_cache
1 parent a241cd9 commit 8d85624

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

Modules/_ctypes/_ctypes.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6080,7 +6080,6 @@ _ctypes_add_objects(PyObject *mod)
60806080
} while (0)
60816081

60826082
ctypes_state *st = get_module_state(mod);
6083-
MOD_ADD("_pointer_type_cache", Py_NewRef(st->_ctypes_ptrtype_cache));
60846083

60856084
#ifdef MS_WIN32
60866085
MOD_ADD("COMError", Py_NewRef(st->PyComError_Type));
@@ -6141,11 +6140,6 @@ _ctypes_mod_exec(PyObject *mod)
61416140
return -1;
61426141
}
61436142

6144-
st->_ctypes_ptrtype_cache = PyDict_New();
6145-
if (st->_ctypes_ptrtype_cache == NULL) {
6146-
return -1;
6147-
}
6148-
61496143
st->PyExc_ArgError = PyErr_NewException("ctypes.ArgumentError", NULL, NULL);
61506144
if (!st->PyExc_ArgError) {
61516145
return -1;
@@ -6165,7 +6159,6 @@ _ctypes_mod_exec(PyObject *mod)
61656159
static int
61666160
module_traverse(PyObject *module, visitproc visit, void *arg) {
61676161
ctypes_state *st = get_module_state(module);
6168-
Py_VISIT(st->_ctypes_ptrtype_cache);
61696162
Py_VISIT(st->_unpickle);
61706163
Py_VISIT(st->array_cache);
61716164
Py_VISIT(st->error_object_name);
@@ -6200,7 +6193,6 @@ module_traverse(PyObject *module, visitproc visit, void *arg) {
62006193
static int
62016194
module_clear(PyObject *module) {
62026195
ctypes_state *st = get_module_state(module);
6203-
Py_CLEAR(st->_ctypes_ptrtype_cache);
62046196
Py_CLEAR(st->_unpickle);
62056197
Py_CLEAR(st->array_cache);
62066198
Py_CLEAR(st->error_object_name);

Modules/_ctypes/ctypes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ typedef struct {
8181
#ifdef MS_WIN32
8282
PyTypeObject *PyComError_Type;
8383
#endif
84-
/* This dict maps ctypes types to POINTER types */
85-
PyObject *_ctypes_ptrtype_cache;
8684
/* a callable object used for unpickling:
8785
strong reference to _ctypes._unpickle() function */
8886
PyObject *_unpickle;

0 commit comments

Comments
 (0)