Import ujson when available for speed improvements on large hstore operations

This commit is contained in:
Morgan McClure 2015-08-11 08:10:40 -07:00
parent 925fdf5731
commit 139143ae62

View File

@ -34,13 +34,16 @@ from psycopg2._psycopg import new_type, new_array_type, register_type
# import the best json implementation available # import the best json implementation available
if sys.version_info[:2] >= (2,6): try:
import json import ujson as json
else: except ImportError:
try: if sys.version_info[:2] >= (2,6):
import simplejson as json import json
except ImportError: else:
json = None try:
import simplejson as json
except ImportError:
json = None
# oids from PostgreSQL 9.2 # oids from PostgreSQL 9.2