/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: 2010-11-29 23:35:13 UTC
  • mto: (5050.58.1 2.2)
  • mto: This revision was merged to the branch mainline in revision 5555.
  • Revision ID: aaron@aaronbentley.com-20101129233513-jvkfdyrog2xfvl31
Make is_executable treat symlinks and directories the same across tree types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        from xml.etree.cElementTree import (ElementTree, SubElement, Element,
32
32
            XMLTreeBuilder, fromstring, tostring)
33
33
        import xml.etree as elementtree
 
34
        # Also import ElementTree module so monkey-patching below always works
 
35
        import xml.etree.ElementTree
34
36
    except ImportError:
35
37
        from cElementTree import (ElementTree, SubElement, Element,
36
38
                                  XMLTreeBuilder, fromstring, tostring)
83
85
 
84
86
    def read_inventory(self, f, revision_id=None):
85
87
        try:
86
 
            return self._unpack_inventory(self._read_element(f),
87
 
                revision_id=None)
 
88
            try:
 
89
                return self._unpack_inventory(self._read_element(f),
 
90
                    revision_id=None)
 
91
            finally:
 
92
                f.close()
88
93
        except ParseError, e:
89
94
            raise errors.UnexpectedInventoryFormat(e)
90
95