Improved python 3 compatibility of gridtk.