diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-03-25 07:08:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 23:08:51 +0100 |
commit | 37fcbb65d4589fbb5a72153e9338cf8e6495f64f (patch) | |
tree | e0c1e2f0b9d5673779ec74b71fef3fc158158ae1 /Modules/_blake2 | |
parent | bpo-40029 mark test_importlib.test_zip as requiring zlib (#19105) (diff) | |
download | cpython-37fcbb65d4589fbb5a72153e9338cf8e6495f64f.tar.gz cpython-37fcbb65d4589fbb5a72153e9338cf8e6495f64f.tar.bz2 cpython-37fcbb65d4589fbb5a72153e9338cf8e6495f64f.zip |
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/_blake2')
-rw-r--r-- | Modules/_blake2/blake2module.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Modules/_blake2/blake2module.c b/Modules/_blake2/blake2module.c index 9d280a9ccd5..ff142c9f3ed 100644 --- a/Modules/_blake2/blake2module.c +++ b/Modules/_blake2/blake2module.c @@ -63,13 +63,10 @@ PyInit__blake2(void) /* BLAKE2b */ Py_SET_TYPE(&PyBlake2_BLAKE2bType, &PyType_Type); - if (PyType_Ready(&PyBlake2_BLAKE2bType) < 0) { + if (PyModule_AddType(m, &PyBlake2_BLAKE2bType) < 0) { return NULL; } - Py_INCREF(&PyBlake2_BLAKE2bType); - PyModule_AddObject(m, "blake2b", (PyObject *)&PyBlake2_BLAKE2bType); - d = PyBlake2_BLAKE2bType.tp_dict; ADD_INT(d, "SALT_SIZE", BLAKE2B_SALTBYTES); ADD_INT(d, "PERSON_SIZE", BLAKE2B_PERSONALBYTES); @@ -83,13 +80,10 @@ PyInit__blake2(void) /* BLAKE2s */ Py_SET_TYPE(&PyBlake2_BLAKE2sType, &PyType_Type); - if (PyType_Ready(&PyBlake2_BLAKE2sType) < 0) { + if (PyModule_AddType(m, &PyBlake2_BLAKE2sType) < 0) { return NULL; } - Py_INCREF(&PyBlake2_BLAKE2sType); - PyModule_AddObject(m, "blake2s", (PyObject *)&PyBlake2_BLAKE2sType); - d = PyBlake2_BLAKE2sType.tp_dict; ADD_INT(d, "SALT_SIZE", BLAKE2S_SALTBYTES); ADD_INT(d, "PERSON_SIZE", BLAKE2S_PERSONALBYTES); |