/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/xml_serializer.py

  • Committer: Aaron Bentley
  • Date: 2007-02-06 14:52:16 UTC
  • mfrom: (2266 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2268.
  • Revision ID: abentley@panoramicfeedback.com-20070206145216-fcpi8o3ufvuzwbp9
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: UTF-8 -*-
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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)