Fix inlining to work under both py2 and py3.