Rev 4856: (vila) Prevent AttributeError in xml_serializer on certain cElementTree in file:///home/pqm/archives/thelove/bzr/2.1/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Sep 13 09:32:01 BST 2010


At file:///home/pqm/archives/thelove/bzr/2.1/

------------------------------------------------------------
revno: 4856 [merge]
revision-id: pqm at pqm.ubuntu.com-20100913083159-449hvur7t494zck9
parent: pqm at pqm.ubuntu.com-20100910074718-wqchk1rvjpvc6so9
parent: gzlist at googlemail.com-20100909172410-5pgfvsx8mst0d3af
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.1
timestamp: Mon 2010-09-13 09:31:59 +0100
message:
  (vila) Prevent AttributeError in xml_serializer on certain cElementTree
   setups (Martin [gz])
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/xml_serializer.py       xml.py-20050309040759-57d51586fdec365d
=== modified file 'NEWS'
--- a/NEWS	2010-09-10 05:13:57 +0000
+++ b/NEWS	2010-09-13 08:31:59 +0000
@@ -48,6 +48,10 @@
 * Raise ValueError instead of a string exception.
   (John Arbash Meinel, #586926)
 
+* Stop ``AttributeError: 'module' object has no attribute 'ElementTree'``
+  being thrown from ``xml_serializer`` on certain cElementTree setups.
+  (Martin [gz], #254278)
+
 Improvements
 ************
 

=== modified file 'bzrlib/xml_serializer.py'
--- a/bzrlib/xml_serializer.py	2010-02-17 17:11:16 +0000
+++ b/bzrlib/xml_serializer.py	2010-09-09 17:24:10 +0000
@@ -31,6 +31,8 @@
         from xml.etree.cElementTree import (ElementTree, SubElement, Element,
             XMLTreeBuilder, fromstring, tostring)
         import xml.etree as elementtree
+        # Also import ElementTree module so monkey-patching below always works
+        import xml.etree.ElementTree
     except ImportError:
         from cElementTree import (ElementTree, SubElement, Element,
                                   XMLTreeBuilder, fromstring, tostring)




More information about the bazaar-commits mailing list