From b8b473bf19de5309f65392010a140945736254e8 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Wed, 21 Oct 2015 15:28:26 -0700 Subject: [PATCH] cdxindexer: use ujson if it is available --- pywb/warc/cdxindexer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pywb/warc/cdxindexer.py b/pywb/warc/cdxindexer.py index 28f9a023..819194ae 100644 --- a/pywb/warc/cdxindexer.py +++ b/pywb/warc/cdxindexer.py @@ -1,7 +1,12 @@ import os import sys -from json import dumps as json_encode +# Use ujson if available +try: + from ujson import dumps as json_encode +except: + from json import dumps as json_encode + try: # pragma: no cover from collections import OrderedDict