mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
gh-86493: Use PyModule_Add() instead of PyModule_AddObjectRef() (GH-106860)
This commit is contained in:
parent
40f3f11a77
commit
a293fa5915
14 changed files with 26 additions and 116 deletions
|
|
@ -1496,13 +1496,7 @@ unicodedata_exec(PyObject *module)
|
|||
}
|
||||
|
||||
/* Export C API */
|
||||
PyObject *capsule = unicodedata_create_capi();
|
||||
if (capsule == NULL) {
|
||||
return -1;
|
||||
}
|
||||
int rc = PyModule_AddObjectRef(module, "_ucnhash_CAPI", capsule);
|
||||
Py_DECREF(capsule);
|
||||
if (rc < 0) {
|
||||
if (PyModule_Add(module, "_ucnhash_CAPI", unicodedata_create_capi()) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue