p3k compat

Added py3k compatibility.