mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +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;
|
PyObject *m, *d, *v;
|
||||||
|
|
||||||
m = Py_InitModule4(
|
m = Py_InitModule3(
|
||||||
"unicodedata", unicodedata_functions,
|
"unicodedata", unicodedata_functions, unicodedata_docstring);
|
||||||
unicodedata_docstring, NULL, PYTHON_API_VERSION);
|
|
||||||
if (!m)
|
if (!m)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -475,7 +474,8 @@ initunicodedata(void)
|
||||||
|
|
||||||
/* Export C API */
|
/* Export C API */
|
||||||
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
|
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
|
||||||
PyDict_SetItemString(d, "ucnhash_CAPI", v);
|
if (v != NULL) {
|
||||||
Py_XDECREF(v);
|
PyDict_SetItemString(d, "ucnhash_CAPI", v);
|
||||||
|
Py_DECREF(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue