working on python3 version

Signed-off-by: Ronaldo Nascimento <ronaldo1@users.sf.net>