Commit a2bd8d38 authored by Fred Drake's avatar Fred Drake

Remove direct manipulation of the module dict.

parent 8f3078b3
...@@ -463,21 +463,15 @@ static char *unicodedata_docstring = "unicode character database"; ...@@ -463,21 +463,15 @@ static char *unicodedata_docstring = "unicode character database";
DL_EXPORT(void) DL_EXPORT(void)
initunicodedata(void) initunicodedata(void)
{ {
PyObject *m, *d, *v; PyObject *m, *v;
m = Py_InitModule3( m = Py_InitModule3(
"unicodedata", unicodedata_functions, unicodedata_docstring); "unicodedata", unicodedata_functions, unicodedata_docstring);
if (!m) if (!m)
return; return;
d = PyModule_GetDict(m);
if (!d)
return;
/* Export C API */ /* Export C API */
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL); v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
if (v != NULL) { if (v != NULL)
PyDict_SetItemString(d, "ucnhash_CAPI", v); PyModule_AddObject(m, "ucnhash_CAPI", v);
Py_DECREF(v);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment