Adapt python wrapper.