Fix py3 compatibility in doc example