mirror of
https://github.com/python/cpython.git
synced 2025-12-11 03:20:01 +00:00
Include the version-detecting code to allow PyXML to override the "standard"
xml package. Require at least PyXML 0.6.1.
This commit is contained in:
parent
ef5781b8c8
commit
af57431701
1 changed files with 19 additions and 2 deletions
|
|
@ -13,10 +13,27 @@ sax -- The Simple API for XML, developed by XML-Dev, led by David
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["dom", "parsers", "sax"]
|
||||||
|
|
||||||
|
__version__ = "$Revision$"[1:-1].split()[1]
|
||||||
|
|
||||||
|
|
||||||
|
_MINIMUM_XMLPLUS_VERSION = (0, 6, 1)
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import _xmlplus
|
import _xmlplus
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
|
v = _xmlplus.version_info
|
||||||
|
except AttributeError:
|
||||||
|
# _xmlplue is too old; ignore it
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if v >= _MINIMUM_XMLPLUS_VERSION:
|
||||||
import sys
|
import sys
|
||||||
sys.modules[__name__] = _xmlplus
|
sys.modules[__name__] = _xmlplus
|
||||||
|
else:
|
||||||
|
del v
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue