From f9ab24a077ad19f6ccd7fcb6151101c95b451113 Mon Sep 17 00:00:00 2001 From: Alec Buckenheimer Date: Thu, 16 Feb 2017 15:03:52 -0500 Subject: [PATCH] #449 use stdlib json module if ujson is unavailible --- sanic/request.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sanic/request.py b/sanic/request.py index 086d749d..98381aae 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -4,7 +4,10 @@ from http.cookies import SimpleCookie from httptools import parse_url from urllib.parse import parse_qs -from ujson import loads as json_loads +try: + from ujson import loads as json_loads +except ImportError: + from json import loads as json_loads from sanic.exceptions import InvalidUsage from sanic.log import log