Compatibility with python 3
Updated in order to test on python 3. and on python 2.6