py2 code for wrapper