Fix python3 compatibility

Signed-off-by: Jonas Kalderstam <jonas@kalderstam.se>