summaryrefslogtreecommitdiffstats
path: root/Modules/unicodedata.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r--Modules/unicodedata.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 56c9466..69345ea 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -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);
+ }
}