From e880a42099f1e3df1bd628058ba9e3a38a5ef0c8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 24 Nov 2010 03:15:22 -0500 Subject: - Add support for json on GAE by catching NotImplementedError and importing simplejson from django.utils. --- CHANGES.txt | 3 +++ pyramid/compat/__init__.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2ea0ac448..b8c3a847f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,9 @@ Features - ``pyramid.testig.DummyRequest`` now has a class variable, ``query_string``, which defaults to the empty string. +- Add support for json on GAE by catching NotImplementedError and importing + simplejson from django.utils. + Bug Fixes --------- diff --git a/pyramid/compat/__init__.py b/pyramid/compat/__init__.py index 205175132..8bbf79703 100644 --- a/pyramid/compat/__init__.py +++ b/pyramid/compat/__init__.py @@ -133,7 +133,12 @@ except NameError: # pragma: no cover try: import json except ImportError: # pragma: no cover - import simplejson as json + try: + import simplejson as json + except NotImplementedError: + from django.utils import simplejson as json # GAE + + try: from hashlib import md5 -- cgit v1.2.3