Moved from python2 syntax to 3 [skip ci]