Add Py3K backwards-compatibility shim

Does what it says on the tin.