[graph-tool] Python 2 compatibility