Fix Python 3.x compatibility

map() is a generator in Py3