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 6be838a commit f585befCopy full SHA for f585bef
1 file changed
Modules/unicodedata.c
@@ -463,9 +463,8 @@ initunicodedata(void)
463
{
464
PyObject *m, *d, *v;
465
466
- m = Py_InitModule4(
467
- "unicodedata", unicodedata_functions,
468
- unicodedata_docstring, NULL, PYTHON_API_VERSION);
+ m = Py_InitModule3(
+ "unicodedata", unicodedata_functions, unicodedata_docstring);
469
if (!m)
470
return;
471
@@ -475,7 +474,8 @@ initunicodedata(void)
475
474
476
/* Export C API */
477
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
478
- PyDict_SetItemString(d, "ucnhash_CAPI", v);
479
- Py_XDECREF(v);
480
-
+ if (v != NULL) {
+ PyDict_SetItemString(d, "ucnhash_CAPI", v);
+ Py_DECREF(v);
+ }
481
}
0 commit comments