Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f3078b commit a2bd8d3Copy full SHA for a2bd8d3
1 file changed
Modules/unicodedata.c
@@ -463,21 +463,15 @@ static char *unicodedata_docstring = "unicode character database";
463
DL_EXPORT(void)
464
initunicodedata(void)
465
{
466
- PyObject *m, *d, *v;
+ PyObject *m, *v;
467
468
m = Py_InitModule3(
469
"unicodedata", unicodedata_functions, unicodedata_docstring);
470
if (!m)
471
return;
472
473
- d = PyModule_GetDict(m);
474
- if (!d)
475
- return;
476
-
477
/* Export C API */
478
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
479
- if (v != NULL) {
480
- PyDict_SetItemString(d, "ucnhash_CAPI", v);
481
- Py_DECREF(v);
482
- }
+ if (v != NULL)
+ PyModule_AddObject(m, "ucnhash_CAPI", v);
483
}
0 commit comments