mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Be a bit more strict in setting up the export of the C API for this
module; do not attempt to insert the API object into the module dict if there was an error creating it.
This commit is contained in:
parent
6be838a0c0
commit
f585bef504
1 changed files with 6 additions and 6 deletions
|
@ -463,9 +463,8 @@ initunicodedata(void)
|
|||
{
|
||||
PyObject *m, *d, *v;
|
||||
|
||||
m = Py_InitModule4(
|
||||
"unicodedata", unicodedata_functions,
|
||||
unicodedata_docstring, NULL, PYTHON_API_VERSION);
|
||||
m = Py_InitModule3(
|
||||
"unicodedata", unicodedata_functions, unicodedata_docstring);
|
||||
if (!m)
|
||||
return;
|
||||
|
||||
|
@ -475,7 +474,8 @@ initunicodedata(void)
|
|||
|
||||
/* Export C API */
|
||||
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
|
||||
PyDict_SetItemString(d, "ucnhash_CAPI", v);
|
||||
Py_XDECREF(v);
|
||||
|
||||
if (v != NULL) {
|
||||
PyDict_SetItemString(d, "ucnhash_CAPI", v);
|
||||
Py_DECREF(v);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue