mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 15:37:17 +02:00
Fixed an simplejson deprecation, switching to python json.
This commit is contained in:
parent
972e47e66c
commit
ec54de4797
1 changed files with 3 additions and 3 deletions
|
|
@ -17,11 +17,11 @@ found on http://localhost:8000/webclient.)
|
|||
to sessions connected over the webclient.
|
||||
"""
|
||||
import time
|
||||
import json
|
||||
from hashlib import md5
|
||||
|
||||
from twisted.web import server, resource
|
||||
|
||||
from django.utils import simplejson
|
||||
from django.utils.functional import Promise
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.conf import settings
|
||||
|
|
@ -38,7 +38,7 @@ ENCODINGS = settings.ENCODINGS
|
|||
# extend this if one wants to send more
|
||||
# complex database objects too.
|
||||
|
||||
class LazyEncoder(simplejson.JSONEncoder):
|
||||
class LazyEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
if isinstance(obj, Promise):
|
||||
return force_unicode(obj)
|
||||
|
|
@ -46,7 +46,7 @@ class LazyEncoder(simplejson.JSONEncoder):
|
|||
|
||||
|
||||
def jsonify(obj):
|
||||
return utils.to_str(simplejson.dumps(obj, ensure_ascii=False, cls=LazyEncoder))
|
||||
return utils.to_str(json.dumps(obj, ensure_ascii=False, cls=LazyEncoder))
|
||||
|
||||
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue