[snowy] Use simplejson as a fallback when using python 2.5



commit a71d393c9021d23ca70c85ee5e56284499c5a7e1
Author: Benoit Garret <benoit garret_gnome gadz org>
Date:   Tue Jul 21 11:37:58 2009 -0400

    Use simplejson as a fallback when using python 2.5
    
    Closes: #588528
    Signed-off-by: Brad Taylor <brad getcoded net>

 api/handlers.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/api/handlers.py b/api/handlers.py
index b4ac23e..6cac237 100644
--- a/api/handlers.py
+++ b/api/handlers.py
@@ -31,7 +31,13 @@ from snowy.notes.models import Note
 from snowy.notes.models import NoteTag
 from snowy import settings
 
-import json, pytz
+import pytz
+
+# Use simplejson or Python 2.6 json, prefer simplejson.
+try:
+    import simplejson as json
+except ImportError:
+    import json
 
 class catch_and_return(object):
     def __init__(self, err, response):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]