Made get_as_python Python3 compatible.