avoid duplicate Py3k compatibility code