~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml_serializer.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-28 10:06:33 UTC
  • mfrom: (2039.2.1 python25)
  • Revision ID: pqm@pqm.ubuntu.com-20060928100633-c8c5bc2d065bfc0d
(mbp) find elementtree from python2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib.trace import mutter, warning
26
26
 
27
27
try:
28
 
    from cElementTree import (ElementTree, SubElement, Element,
29
 
                              XMLTreeBuilder, fromstring, tostring)
30
 
    import elementtree
 
28
    try:
 
29
        # it's in this package in python2.5
 
30
        from xml.etree.cElementTree import (ElementTree, SubElement, Element,
 
31
            XMLTreeBuilder, fromstring, tostring)
 
32
        import xml.etree as elementtree
 
33
    except ImportError:
 
34
        from cElementTree import (ElementTree, SubElement, Element,
 
35
                                  XMLTreeBuilder, fromstring, tostring)
 
36
        import elementtree
31
37
    ParseError = SyntaxError
32
38
except ImportError:
33
39
    mutter('WARNING: using slower ElementTree; consider installing cElementTree'
34
40
           " and make sure it's on your PYTHONPATH")
 
41
    # this copy is shipped with bzr
35
42
    from util.elementtree.ElementTree import (ElementTree, SubElement,
36
43
                                              Element, XMLTreeBuilder,
37
44
                                              fromstring, tostring)