Fixed #10006 -- Avoid inadvertently using third-party "json" module.
In r9707 we added a preference to use Python's standard json module (Python 2.6 and beyond). However, there is also a third-party module called json that was being picked up by accident if it was installed. It isn't API compatible, so bad things happened. This change avoids that problem. Patch from markmuetz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9910 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0dd4ec654f
commit
e20f09c2d0
|
@ -119,8 +119,14 @@ except ImportError:
|
||||||
if not use_system_version:
|
if not use_system_version:
|
||||||
try:
|
try:
|
||||||
from json import * # Python 2.6 preferred over local copy.
|
from json import * # Python 2.6 preferred over local copy.
|
||||||
|
|
||||||
|
# There is a "json" package around that is not Python's "json", so we
|
||||||
|
# check for something that is only in the namespace of the version we
|
||||||
|
# want.
|
||||||
|
JSONDecoder
|
||||||
|
|
||||||
use_system_version = True
|
use_system_version = True
|
||||||
except ImportError:
|
except (ImportError, NameError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# If all else fails, we have a bundled version that can be used.
|
# If all else fails, we have a bundled version that can be used.
|
||||||
|
|
Loading…
Reference in New Issue