Be python2 compatible (and python3 too)

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>