@@ -173,7 +173,7 @@ def transfer_to_element_tree(self):
173
173
else :
174
174
element_tree .tag = self .tag
175
175
176
- for key , value in self .attributes .iteritems ( ):
176
+ for key , value in iter ( self .attributes .items () ):
177
177
element_tree .attrib [key ] = value
178
178
179
179
for child in self .children :
@@ -277,7 +277,7 @@ def _extension_element_from_element_tree(element_tree):
277
277
namespace = None
278
278
tag = elementc_tag
279
279
extension = ExtensionElement (namespace = namespace , tag = tag )
280
- for key , value in element_tree .attrib .iteritems ( ):
280
+ for key , value in iter ( element_tree .attrib .items () ):
281
281
extension .attributes [key ] = value
282
282
for child in element_tree :
283
283
extension .children .append (_extension_element_from_element_tree (child ))
@@ -302,7 +302,7 @@ def harvest_element_tree(self, tree):
302
302
# Fill in the instance members from the contents of the XML tree.
303
303
for child in tree :
304
304
self ._convert_element_tree_to_member (child )
305
- for attribute , value in tree .attrib .iteritems ( ):
305
+ for attribute , value in iter ( tree .attrib .items () ):
306
306
self ._convert_element_attribute_to_member (attribute , value )
307
307
self .text = tree .text
308
308
@@ -317,7 +317,7 @@ def _convert_element_attribute_to_member(self, attribute, value):
317
317
def _add_members_to_element_tree (self , tree ):
318
318
for child in self .extension_elements :
319
319
child .become_child_element_of (tree )
320
- for attribute , value in self .extension_attributes .iteritems ( ):
320
+ for attribute , value in iter ( self .extension_attributes .items () ):
321
321
tree .attrib [attribute ] = value
322
322
tree .text = self .text
323
323
@@ -456,7 +456,7 @@ def _get_all_c_children_with_order(self):
456
456
for child in self .c_child_order :
457
457
yield child
458
458
else :
459
- for _ , values in self .__class__ .c_children .iteritems ( ):
459
+ for _ , values in iter ( self .__class__ .c_children .items () ):
460
460
yield values [0 ]
461
461
462
462
def _convert_element_tree_to_member (self , child_tree ):
@@ -507,7 +507,7 @@ def _add_members_to_element_tree(self, tree):
507
507
member .become_child_element_of (tree )
508
508
# Convert the members of this class which are XML attributes.
509
509
for xml_attribute , attribute_info in \
510
- self .__class__ .c_attributes .iteritems ( ):
510
+ iter ( self .__class__ .c_attributes .items () ):
511
511
(member_name , member_type , required ) = attribute_info
512
512
member = getattr (self , member_name )
513
513
if member is not None :
@@ -902,7 +902,7 @@ def element_to_extension_element(element):
902
902
exel .children .extend (element .extension_elements )
903
903
904
904
for xml_attribute , (member_name , typ , req ) in \
905
- element .c_attributes .iteritems ( ):
905
+ iter ( element .c_attributes .items () ):
906
906
member_value = getattr (element , member_name )
907
907
if member_value is not None :
908
908
exel .attributes [xml_attribute ] = member_value
0 commit comments