From 37fcbb65d4589fbb5a72153e9338cf8e6495f64f Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 25 Mar 2020 07:08:51 +0900 Subject: 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(). --- Modules/_csv.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Modules/_csv.c') diff --git a/Modules/_csv.c b/Modules/_csv.c index 968a3d0c7f..9c497154ff 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -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); -- cgit v1.2.1