Regarding issue #466: fix compatibility between Python2 and Python3