compat: fix python3 support.