fixed support for Gedit >3.8/python3