From 1c5c00a2a1bd44c31b8d5a1e14cd60f823daff72 Mon Sep 17 00:00:00 2001 From: "Thomas Bohmbach, Jr" Date: Mon, 14 Sep 2009 14:13:41 -0500 Subject: [PATCH] Changed json import to work on Google App Engine --- tweepy/parsers.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tweepy/parsers.py b/tweepy/parsers.py index 2731e9e..00a7bf6 100644 --- a/tweepy/parsers.py +++ b/tweepy/parsers.py @@ -7,9 +7,15 @@ from datetime import datetime from . models import models try: - import json + import json #Python >= 2.6 except ImportError: - import simplejson as json + try: + import simplejson as json #Python < 2.6 + except ImportError: + try: + from django.utils import simplejson as json #Google App Engine + except ImportError: + raise ImportError, "Can't load a json library" def parse_json(data, api): -- 2.25.1