restore python3 compatibility