On Python <= 2.6, use simplejson if available
Until Python 2.7, stdlib json module was not boosted with a C extension,
meaning bad performance. Try to use simplejson module if available.
RHEL 6.5 is one of the platforms that still ship Python 2.6.
The original idea of the patch belongs to Miguel Angel Ajo Pelayo @
mangelajo@redhat.com
Change-Id: Ib3dc0b713ed90396919feba018772243b3b9c90f
Closes-Bug: 1314129
(cherry picked from commit a6b2aecf3a
)
This commit is contained in:
parent
4c738572b2
commit
d14f56f02a
|
@ -35,7 +35,17 @@ import datetime
|
|||
import functools
|
||||
import inspect
|
||||
import itertools
|
||||
import json
|
||||
import sys
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
# On Python <= 2.6, json module is not C boosted, so try to use
|
||||
# simplejson module if available
|
||||
try:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
import json
|
||||
else:
|
||||
import json
|
||||
|
||||
import six
|
||||
import six.moves.xmlrpc_client as xmlrpclib
|
||||
|
|
Loading…
Reference in New Issue