Add python3 polyfill for tests