Permalink
Browse files

Restored 2.5 compatibility and actual fix for the json problem

  • Loading branch information...
mitsuhiko committed Jul 4, 2010
1 parent 80eb6cf commit 51a89bf35ec6231d55f5caa8e12484e801f593fe
Showing with 9 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +5 −1 flask/helpers.py
  3. +1 −1 flask/module.py
  4. +1 −2 flask/wrappers.py
View
@@ -2,6 +2,8 @@
*.pyc
*.pyo
env
+env*
dist
+*.egg
*.egg-info
_mailinglist
View
@@ -19,6 +19,7 @@
# try to load the best simplejson implementation available. If JSON
# is not installed, we add a failing class.
json_available = True
+json = None
try:
import simplejson as json
except ImportError:
@@ -32,7 +33,6 @@
from jinja2 import FileSystemLoader
from .globals import session, _request_ctx_stack, current_app, request
-from .wrappers import Response
def _assert_have_json():
@@ -364,3 +364,7 @@ def open_resource(self, resource):
subfolders use forward slashes as separator.
"""
return open(os.path.join(self.root_path, resource), 'rb')
+
+
+# circular dependencies between wrappers and helpers
+from .wrappers import Response
View
@@ -9,7 +9,7 @@
:license: BSD, see LICENSE for more details.
"""
-from flask.helpers import _PackageBoundObject
+from .helpers import _PackageBoundObject
def _register_module(module, static_path):
View
@@ -12,7 +12,7 @@
from werkzeug import Request as RequestBase, Response as ResponseBase, \
cached_property
-from .helpers import json
+from .helpers import json, _assert_have_json
class Request(RequestBase):
@@ -52,7 +52,6 @@ def json(self):
parsed JSON data.
"""
if __debug__:
- from flask.helpers import _assert_have_json
_assert_have_json()
if self.mimetype == 'application/json':
return json.loads(self.data)

0 comments on commit 51a89bf

Please sign in to comment.