Skip to content

Commit

Permalink
[fea] use ujson as default
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Mar 4, 2015
1 parent 6725054 commit 4582ba5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from distutils.core import setup


__version__ = '0.2.0pre'
__version__ = '0.2.0'
__author__ = 'Dmitry Orlov <[email protected]>'


Expand All @@ -27,5 +27,5 @@
long_description=open('README.rst').read(),
packages=['wsrpc', 'wsrpc.websocket',],
package_data={ 'wsrpc': ['static/*'], },
install_requires = ['tornado'],
install_requires = ['tornado', 'ujson'],
)
7 changes: 2 additions & 5 deletions wsrpc/websocket/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ def itervalues(d):
def iteritems(d):
return d.iteritems()

try:
import ujson as json
except ImportError:
import json
import ujson as json

class Lazy(object):
def __init__(self,func):
Expand Down Expand Up @@ -198,7 +195,7 @@ def _send_ping(self):
ioloop.call_later(self._KEEPALIVE_PING_TIMEOUT, self._send_ping)

def _to_json(self, **kwargs):
return json.dumps(kwargs, default=repr, sort_keys=False, indent=None, ensure_ascii=False, encoding='utf-8')
return json.dumps(kwargs, ensure_ascii=False)

def _data_load(self, data_string):
try:
Expand Down

0 comments on commit 4582ba5

Please sign in to comment.