diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-03-24 22:08:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 22:08:51 (GMT) |
commit | 37fcbb65d4589fbb5a72153e9338cf8e6495f64f (patch) | |
tree | e0c1e2f0b9d5673779ec74b71fef3fc158158ae1 /Modules/_csv.c | |
parent | 15e5024d04fc89d948ae761d88048bc58a56b650 (diff) | |
download | cpython-37fcbb65d4589fbb5a72153e9338cf8e6495f64f.zip cpython-37fcbb65d4589fbb5a72153e9338cf8e6495f64f.tar.gz cpython-37fcbb65d4589fbb5a72153e9338cf8e6495f64f.tar.bz2 |
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().
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r-- | Modules/_csv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c index 968a3d0..9c49715 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); |