mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +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
|
@ -1633,9 +1633,6 @@ PyInit__csv(void)
|
|||
PyObject *module;
|
||||
const StyleDesc *style;
|
||||
|
||||
if (PyType_Ready(&Dialect_Type) < 0)
|
||||
return NULL;
|
||||
|
||||
if (PyType_Ready(&Reader_Type) < 0)
|
||||
return NULL;
|
||||
|
||||
|
@ -1671,10 +1668,9 @@ PyInit__csv(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Add the Dialect type */
|
||||
Py_INCREF(&Dialect_Type);
|
||||
if (PyModule_AddObject(module, "Dialect", (PyObject *)&Dialect_Type))
|
||||
if (PyModule_AddType(module, &Dialect_Type)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Add the CSV exception object to the module. */
|
||||
get_csv_state(module)->error_obj = PyErr_NewException("_csv.Error", NULL, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue