Fix python3 compatibility

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>