From af4e54b3b9ef04baf5e1d07718c2abd79d34fcca Mon Sep 17 00:00:00 2001 From: Kyle Maxwell Date: Fri, 6 Mar 2009 15:05:18 -0800 Subject: [PATCH] works with python2.5 and simplejson --- pyparsleymodule.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyparsleymodule.c b/pyparsleymodule.c index 230e3fa..350bf3f 100644 --- a/pyparsleymodule.c +++ b/pyparsleymodule.c @@ -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;