~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml_serializer.py

  • Committer: mbp at sourcefrog
  • Date: 2006-06-15 04:56:34 UTC
  • mto: This revision was merged to the branch mainline in revision 1773.
  • Revision ID: mbp@sourcefrog.net-20060615045634-dad8a3f98d0db70b
Fix up loading of fallback ElementTree

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
try:
28
28
    from cElementTree import (ElementTree, SubElement, Element,
29
29
                              XMLTreeBuilder, fromstring, tostring)
 
30
    import elementtree
30
31
except ImportError:
31
32
    mutter('WARNING: using slower ElementTree; consider installing cElementTree'
32
33
           " and make sure it's on your PYTHONPATH")
33
34
    from util.elementtree.ElementTree import (ElementTree, SubElement,
34
35
                                              Element, XMLTreeBuilder,
35
36
                                              fromstring, tostring)
 
37
    import util.elementtree as elementtree
36
38
 
37
39
from bzrlib.errors import BzrError
38
40
 
73
75
        return ElementTree().parse(f)
74
76
 
75
77
 
76
 
# performance tuning for elementree's serialiser. THis should be
 
78
# performance tuning for elementree's serialiser. This should be
77
79
# sent upstream - RBC 20060523.
78
80
# the functions here are patched into elementtree at runtime.
79
 
import elementtree.ElementTree
80
81
import re
81
82
escape_re = re.compile("[&'\"<>]")
82
83
escape_map = {