If python_wrapper_setup has been called once already for a given value of EPYTHON, subsequent calls to python_wrapper_setup with the same EPYTHON do nothing. This is bad because we set some environment variables like PATH and PKG_CONFIG_SETUP in this function.
Grepping the tree, I think this issue came up in app-emulation/lxc. That ebuild currently does this: src_configure() { append-flags -fno-strict-aliasing if use python; then #541932 python_setup "python3*" export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}" fi ... } I'm guessing python_wrapper_setup gets called during some earlier distutils-r1 phase function.
This was fixed recently. ycommit ce87e4f32b37cd41d5f69d089b8ac454ea467974 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: Sun Feb 26 11:02:07 2017 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: Wed Mar 8 08:35:39 2017 python-utils-r1.eclass: python_wrapper_setup, fix exporting env Fix python_wrapper_setup function to move setting environment variables for PATH and PKG_CONFIG_PATH outside the 'if'. Otherwise, they are only set on the initial invocation of python_wrapper_setup for the particular impl and do not apply to subsequent invocations (e.g. further distutils-r1 phases).