fix python2 compatibility

https://www.youtube.com/watch?v=gp5JCrSXkJY