works with python2.5 and simplejson

This commit is contained in:
Kyle Maxwell 2009-03-06 15:05:18 -08:00
parent b873eff139
commit af4e54b3b9
1 changed files with 5 additions and 2 deletions

View File

@ -34,8 +34,11 @@ PyMODINIT_FUNC
initpyparsley(void)
{
jsonmodule = PyImport_ImportModule("json");
if(jsonmodule == NULL)
return NULL;
if(jsonmodule == NULL) {
PyErr_Clear();
jsonmodule = PyImport_ImportModule("simplejson");
}
if(jsonmodule == NULL) return NULL;
PyObject* m;