python: fix code to reflect last API changes
2 files changed