Make python script v3 compatible

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>