Wrapped bytes acceptance on python 3.5
This commit is contained in:
parent
7a0072a036
commit
47bad9ecc9
|
@ -7,7 +7,10 @@ from urllib.parse import parse_qs
|
|||
try:
|
||||
from ujson import loads as json_loads
|
||||
except ImportError:
|
||||
from json import loads as json_loads
|
||||
from json import loads as _json_loads
|
||||
def json_loads(i):
|
||||
i = i.decode() if isinstance(i, bytes) else i
|
||||
return _json_loads(i)
|
||||
|
||||
from sanic.exceptions import InvalidUsage
|
||||
from sanic.log import log
|
||||
|
|
Loading…
Reference in New Issue
Block a user