From 0198313a22a98361947fceb8544c355be676f784 Mon Sep 17 00:00:00 2001 From: Thomas Schranz Date: Thu, 8 Jul 2010 00:10:29 +0800 Subject: [PATCH 1/2] added workaround for json on Google AppEngine Google AppEngine unfortunately does not offer json/simplejson where we would expect it to be, but since they do offer django and django comes with simplejson as a frozen dependency, we can import it from there. prior art: http://github.com/facebook/python-sdk/blob/master/src/facebook.py#L50 --- flask/helpers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flask/helpers.py b/flask/helpers.py index 560492c6..420bfab8 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -26,7 +26,12 @@ except ImportError: try: import json except ImportError: - json_available = False + try: + # Google Appengine offers simplejson via django + from django.utils import simplejson as json + except ImportError: + json_available = False + from werkzeug import Headers, wrap_file, is_resource_modified, cached_property from werkzeug.exceptions import NotFound From f3b6d94bf732a913aaf2005ad2656ee31ef8f6c6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 7 Jul 2010 09:19:41 -0700 Subject: [PATCH 2/2] added Thomas Schranz to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index e20a3735..c2415977 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,4 +24,5 @@ Patches and Suggestions - Sebastien Estienne - Simon Sapin - Stephane Wirtel +- Thomas Schranz - Zhao Xiaohong