mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-40024: Update C extension modules to use PyModule_AddType() (GH-19119)
Update _asyncio, _bz2, _csv, _curses, _datetime, _io, _operator, _pickle, _queue, blake2, multibytecodec and overlapped C extension modules to use PyModule_AddType().
This commit is contained in:
parent
15e5024d04
commit
37fcbb65d4
12 changed files with 66 additions and 133 deletions
|
|
@ -7993,10 +7993,6 @@ PyInit__pickle(void)
|
|||
return m;
|
||||
}
|
||||
|
||||
if (PyType_Ready(&Unpickler_Type) < 0)
|
||||
return NULL;
|
||||
if (PyType_Ready(&Pickler_Type) < 0)
|
||||
return NULL;
|
||||
if (PyType_Ready(&Pdata_Type) < 0)
|
||||
return NULL;
|
||||
if (PyType_Ready(&PicklerMemoProxyType) < 0)
|
||||
|
|
@ -8010,16 +8006,15 @@ PyInit__pickle(void)
|
|||
return NULL;
|
||||
|
||||
/* Add types */
|
||||
Py_INCREF(&Pickler_Type);
|
||||
if (PyModule_AddObject(m, "Pickler", (PyObject *)&Pickler_Type) < 0)
|
||||
if (PyModule_AddType(m, &Pickler_Type) < 0) {
|
||||
return NULL;
|
||||
Py_INCREF(&Unpickler_Type);
|
||||
if (PyModule_AddObject(m, "Unpickler", (PyObject *)&Unpickler_Type) < 0)
|
||||
}
|
||||
if (PyModule_AddType(m, &Unpickler_Type) < 0) {
|
||||
return NULL;
|
||||
Py_INCREF(&PyPickleBuffer_Type);
|
||||
if (PyModule_AddObject(m, "PickleBuffer",
|
||||
(PyObject *)&PyPickleBuffer_Type) < 0)
|
||||
}
|
||||
if (PyModule_AddType(m, &PyPickleBuffer_Type) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
st = _Pickle_GetState(m);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue