Added missing import_array() in python3 generated code.
Removed (hopefully) the last uses of locals() inside list comprehensions.
Merge pull request #1405 from HapeMask/py3k-fixes

Py3k fixes