python: Make type translation compatible with Python 2.7.