Made docstring generation code Python 3 compatible