Catch situations where currentframe() returns None. See SF patch #1447410, this is...
[python.git] / Lib / xml.py
blob7393c66aa2bc9343f18d6355d9bfaabe62057652
1 """Core XML support for Python.
3 This package contains four sub-packages:
5 dom -- The W3C Document Object Model. This supports DOM Level 1 +
6 Namespaces.
8 parsers -- Python wrappers for XML parsers (currently only supports Expat).
10 sax -- The Simple API for XML, developed by XML-Dev, led by David
11 Megginson and ported to Python by Lars Marius Garshol. This
12 supports the SAX 2 API.
14 etree -- The ElementTree XML library. This is a subset of the full
15 ElementTree XML release.
17 """
19 import sys
20 import xmlcore
22 __all__ = ["dom", "parsers", "sax", "etree"]
24 # When being checked-out without options, this has the form
25 # "<dollar>Revision: x.y </dollar>"
26 # When exported using -kv, it is "x.y".
27 __version__ = "$Revision$".split()[-2:][0]
30 _MINIMUM_XMLPLUS_VERSION = (0, 8, 4)
32 try:
33 import _xmlplus
34 except ImportError:
35 sys.modules[__name__] = xmlcore
36 else:
37 try:
38 v = _xmlplus.version_info
39 except AttributeError:
40 # _xmlplus is too old; ignore it
41 pass
42 else:
43 if v >= _MINIMUM_XMLPLUS_VERSION:
44 _xmlplus.__path__.extend(xmlcore.__path__)
45 sys.modules[__name__] = _xmlplus
46 else:
47 del v