fix py3 error for pull request #314