Add missing return to python function