Python 2.6 compatibility: avoid dict comprehensions

Issue #1 new
Hraban Ramm created an issue

In epubzilla/epubzilla.py in line 152 and some later, there are two dict comprehensions that are easily replaced, making the code run under Python 2.6:

# element_class.tag.attributes = { etree.QName(key).localname: value for key,value in element_tree.attrib.iteritems() }
element_class.tag.attributes = dict( (etree.QName(key).localname, value) for key,value in element_tree.attrib.iteritems())

# sub_element_class.tag.attributes = { etree.QName(key).localname: value for key,value in k.attrib.iteritems() }
sub_element_class.tag.attributes = dict( (etree.QName(key).localname, value) for key,value in k.attrib.iteritems() )

Comments (1)

  1. Log in to comment