Changeset - 8a3a1a59a050
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 14 years ago 2012-05-11 01:30:19
marcin@python-works.com
Fixed simplejson import on python 2.5
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/ext_json.py
Show inline comments
 
@@ -81,10 +81,10 @@ except ImportError:
 
    _sj = None
 

	
 

	
 
try:
 
# simplejson not found try out regular json module
 
import json as _json
 

	
 

	
 
# extended JSON encoder for json
 
class ExtendedEncoder(_json.JSONEncoder):
 
    def default(self, obj):
 
@@ -97,6 +97,8 @@ class ExtendedEncoder(_json.JSONEncoder)
 
_json.dumps = functools.partial(_json.dumps, cls=ExtendedEncoder)
 
_json.dump = functools.partial(_json.dump, cls=ExtendedEncoder)
 
stdlib = _json
 
except ImportError:
 
    _json = None
 

	
 
# set all available json modules
 
simplejson = _sj
0 comments (0 inline, 0 general)