summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-11-24 03:15:22 -0500
committerChris McDonough <chrism@plope.com>2010-11-24 03:15:22 -0500
commite880a42099f1e3df1bd628058ba9e3a38a5ef0c8 (patch)
tree779e9cdae4b4b847fbfd56877b0351c50e4fb92b
parent3f61fa08ae42860dde823e610134e4cc2b7ec991 (diff)
downloadpyramid-e880a42099f1e3df1bd628058ba9e3a38a5ef0c8.tar.gz
pyramid-e880a42099f1e3df1bd628058ba9e3a38a5ef0c8.tar.bz2
pyramid-e880a42099f1e3df1bd628058ba9e3a38a5ef0c8.zip
- Add support for json on GAE by catching NotImplementedError and importing
simplejson from django.utils.
-rw-r--r--CHANGES.txt3
-rw-r--r--pyramid/compat/__init__.py7
2 files changed, 9 insertions, 1 deletions
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