]> granicus.if.org Git - python/commitdiff
added cElementTree/_elementtree build stuff and wrapper module
authorFredrik Lundh <fredrik@pythonware.com>
Wed, 14 Dec 2005 18:46:16 +0000 (18:46 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Wed, 14 Dec 2005 18:46:16 +0000 (18:46 +0000)
Lib/xmlcore/etree/cElementTree.py [new file with mode: 0644]
setup.py

diff --git a/Lib/xmlcore/etree/cElementTree.py b/Lib/xmlcore/etree/cElementTree.py
new file mode 100644 (file)
index 0000000..a6f127a
--- /dev/null
@@ -0,0 +1,3 @@
+# Wrapper module for _elementtree
+
+from _elementtree import *
index 8ec8cb0106aff937284fce5a59914afc7cad88e0..462e76bfb45485e1059d3649631fdb59a5089a9f 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -841,6 +841,17 @@ class PyBuildExt(build_ext):
                                          ],
                               ))
 
+        # Fredrik Lundh's cElementTree module.  Note that this also
+        # uses expat (via the CAPI hook in pyexpat).
+
+        if os.path.isfile('Modules/_elementtree.c'):
+            define_macros.append(('USE_PYEXPAT_CAPI', None))
+            exts.append(Extension('_elementtree',
+                                  define_macros = define_macros,
+                                  include_dirs = [expatinc],
+                                  sources = ['_elementtree.c'],
+                                  ))
+
         # Hye-Shik Chang's CJKCodecs modules.
         if have_unicode:
             exts.append(Extension('_multibytecodec',