Fix generation error for Python 2.