mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-08-03 11:50:08 +03:00
Import ujson when available for speed improvements on large hstore operations
This commit is contained in:
parent
925fdf5731
commit
139143ae62
17
lib/_json.py
17
lib/_json.py
|
@ -34,13 +34,16 @@ from psycopg2._psycopg import new_type, new_array_type, register_type
|
|||
|
||||
|
||||
# import the best json implementation available
|
||||
if sys.version_info[:2] >= (2,6):
|
||||
import json
|
||||
else:
|
||||
try:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
json = None
|
||||
try:
|
||||
import ujson as json
|
||||
except ImportError:
|
||||
if sys.version_info[:2] >= (2,6):
|
||||
import json
|
||||
else:
|
||||
try:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
json = None
|
||||
|
||||
|
||||
# oids from PostgreSQL 9.2
|
||||
|
|
Loading…
Reference in New Issue
Block a user