[TEST fix] Fix debugmode checking in python3