bdarnell / torndb

A lightweight wrapper around MySQLdb. Originally part of the Tornado framework.
582 stars 202 forks source link

Update torndb.py #26

Closed xs23933 closed 9 years ago

xs23933 commented 10 years ago

Problem with Python 3.x AttributeError: 'module' object has no attribute 'izip'

bdarnell commented 10 years ago

2.x itertools.izip() is equivalent to 3.x zip(), not itertools.zip_longest(). The try clause here covers a lot of ground; it would be better to do something at top level like

try:
    from itertools import izip
except ImportError:
    izip = zip