From eb023bcfad7741248705f6715055ffe46928b7fe Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 23 May 2013 13:46:51 +0100 Subject: [PATCH] Support old and new name for json --- flask/json.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flask/json.py b/flask/json.py index 717eb2ab..0f1d4c2a 100644 --- a/flask/json.py +++ b/flask/json.py @@ -15,8 +15,11 @@ from .globals import current_app, request from werkzeug.http import http_date # Use the same json implementation as itsdangerous on which we -# depend anyways. -from itsdangerous import simplejson as _json +# depend anyways. This name changed at one point so support both. +try: + from itsdangerous import simplejson as _json +except ImportError: + from itsdangerous import json as _json # figure out if simplejson escapes slashes. This behavior was changed