diff --git a/ch05/so_xml_to_tsv.py b/ch05/so_xml_to_tsv.py index 46559409..df80568f 100644 --- a/ch05/so_xml_to_tsv.py +++ b/ch05/so_xml_to_tsv.py @@ -83,8 +83,8 @@ def parsexml(filename): counter = 0 - it = map(itemgetter(1), - iter(etree.iterparse(filename, events=('start',)))) + it = iter(map(itemgetter(1), + iter(etree.iterparse(filename, events=('start',))))) root = next(it) # get posts element for elem in it: