python 3 support

Signed-off-by: Adam McNicol <adam@mcnicol.me>