mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Fix issue6869: refcount problem in the _ctypes extension.
This commit is contained in:
parent
39d795d8c1
commit
bf4cc5d469
2 changed files with 9 additions and 1 deletions
|
|
@ -24,7 +24,9 @@ Core and Builtins
|
||||||
Extensions
|
Extensions
|
||||||
----------
|
----------
|
||||||
|
|
||||||
- Issue #5504 - ctypes should now work with systems where mmap can't
|
- Issue #6869: Fix a refcount problem in the _ctypes extension.
|
||||||
|
|
||||||
|
- Issue #5504: ctypes should now work with systems where mmap can't
|
||||||
be PROT_WRITE and PROT_EXEC.
|
be PROT_WRITE and PROT_EXEC.
|
||||||
|
|
||||||
- Issue #9507: Named tuple repr will now automatically display the right
|
- Issue #9507: Named tuple repr will now automatically display the right
|
||||||
|
|
|
||||||
|
|
@ -5312,36 +5312,42 @@ PyInit__ctypes(void)
|
||||||
Struct_Type.tp_base = &PyCData_Type;
|
Struct_Type.tp_base = &PyCData_Type;
|
||||||
if (PyType_Ready(&Struct_Type) < 0)
|
if (PyType_Ready(&Struct_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Py_INCREF(&Struct_Type);
|
||||||
PyModule_AddObject(m, "Structure", (PyObject *)&Struct_Type);
|
PyModule_AddObject(m, "Structure", (PyObject *)&Struct_Type);
|
||||||
|
|
||||||
Py_TYPE(&Union_Type) = &UnionType_Type;
|
Py_TYPE(&Union_Type) = &UnionType_Type;
|
||||||
Union_Type.tp_base = &PyCData_Type;
|
Union_Type.tp_base = &PyCData_Type;
|
||||||
if (PyType_Ready(&Union_Type) < 0)
|
if (PyType_Ready(&Union_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Py_INCREF(&Union_Type);
|
||||||
PyModule_AddObject(m, "Union", (PyObject *)&Union_Type);
|
PyModule_AddObject(m, "Union", (PyObject *)&Union_Type);
|
||||||
|
|
||||||
Py_TYPE(&PyCPointer_Type) = &PyCPointerType_Type;
|
Py_TYPE(&PyCPointer_Type) = &PyCPointerType_Type;
|
||||||
PyCPointer_Type.tp_base = &PyCData_Type;
|
PyCPointer_Type.tp_base = &PyCData_Type;
|
||||||
if (PyType_Ready(&PyCPointer_Type) < 0)
|
if (PyType_Ready(&PyCPointer_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Py_INCREF(&PyCPointer_Type);
|
||||||
PyModule_AddObject(m, "_Pointer", (PyObject *)&PyCPointer_Type);
|
PyModule_AddObject(m, "_Pointer", (PyObject *)&PyCPointer_Type);
|
||||||
|
|
||||||
Py_TYPE(&PyCArray_Type) = &PyCArrayType_Type;
|
Py_TYPE(&PyCArray_Type) = &PyCArrayType_Type;
|
||||||
PyCArray_Type.tp_base = &PyCData_Type;
|
PyCArray_Type.tp_base = &PyCData_Type;
|
||||||
if (PyType_Ready(&PyCArray_Type) < 0)
|
if (PyType_Ready(&PyCArray_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Py_INCREF(&PyCArray_Type);
|
||||||
PyModule_AddObject(m, "Array", (PyObject *)&PyCArray_Type);
|
PyModule_AddObject(m, "Array", (PyObject *)&PyCArray_Type);
|
||||||
|
|
||||||
Py_TYPE(&Simple_Type) = &PyCSimpleType_Type;
|
Py_TYPE(&Simple_Type) = &PyCSimpleType_Type;
|
||||||
Simple_Type.tp_base = &PyCData_Type;
|
Simple_Type.tp_base = &PyCData_Type;
|
||||||
if (PyType_Ready(&Simple_Type) < 0)
|
if (PyType_Ready(&Simple_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Py_INCREF(&Simple_Type);
|
||||||
PyModule_AddObject(m, "_SimpleCData", (PyObject *)&Simple_Type);
|
PyModule_AddObject(m, "_SimpleCData", (PyObject *)&Simple_Type);
|
||||||
|
|
||||||
Py_TYPE(&PyCFuncPtr_Type) = &PyCFuncPtrType_Type;
|
Py_TYPE(&PyCFuncPtr_Type) = &PyCFuncPtrType_Type;
|
||||||
PyCFuncPtr_Type.tp_base = &PyCData_Type;
|
PyCFuncPtr_Type.tp_base = &PyCData_Type;
|
||||||
if (PyType_Ready(&PyCFuncPtr_Type) < 0)
|
if (PyType_Ready(&PyCFuncPtr_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Py_INCREF(&PyCFuncPtr_Type);
|
||||||
PyModule_AddObject(m, "CFuncPtr", (PyObject *)&PyCFuncPtr_Type);
|
PyModule_AddObject(m, "CFuncPtr", (PyObject *)&PyCFuncPtr_Type);
|
||||||
|
|
||||||
/*************************************************
|
/*************************************************
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue