Translate to python3 to be compatible with gedit >= 3.8