[Python-checkins] CVS: python/dist/src/Modules unicodedata.c,2.11,2.12
Fred L. Drake
fdrake@users.sourceforge.net
Sat, 03 Mar 2001 11:41:58 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv30269
Modified Files:
unicodedata.c
Log Message:
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.
Index: unicodedata.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v
retrieving revision 2.11
retrieving revision 2.12
diff -C2 -r2.11 -r2.12
*** unicodedata.c 2001/02/18 22:06:17 2.11
--- unicodedata.c 2001/03/03 19:41:55 2.12
***************
*** 464,470 ****
PyObject *m, *d, *v;
! m = Py_InitModule4(
! "unicodedata", unicodedata_functions,
! unicodedata_docstring, NULL, PYTHON_API_VERSION);
if (!m)
return;
--- 464,469 ----
PyObject *m, *d, *v;
! m = Py_InitModule3(
! "unicodedata", unicodedata_functions, unicodedata_docstring);
if (!m)
return;
***************
*** 476,481 ****
/* Export C API */
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
! PyDict_SetItemString(d, "ucnhash_CAPI", v);
! Py_XDECREF(v);
!
}
--- 475,481 ----
/* Export C API */
v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL);
! if (v != NULL) {
! PyDict_SetItemString(d, "ucnhash_CAPI", v);
! Py_DECREF(v);
! }
}