Excerpts from Justin's comments [1]:
At least for Portage 2.1.4.4, /usr/lib64/portage/pym/portage.py's
config class specifically excludes ACCEPT_KEYWORDS. Therefore,
ENV = portage_config(clone=portage_settings).environ()
will never contain ACCEPT_KEYWORDS argument and the arch will always
be ~x86 as the result of get_keyword().
...
After looking at the code, it appears that the PORTAGE_CONFIG variable
introduced in the previous patch can completely replace ENV. Here's
the patch that simply changes:
ENV = portage_config(clone=portage_settings).environ()
to
ENV = portage_config(clone=portage_settings)
[1]: http://code.google.com/p/g-pypi/issues/detail?id=4
__docformat__ = 'restructuredtext'
-ENV = portage_config(clone=portage_settings).environ()
+ENV = portage_config(clone=portage_settings)
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
LOGGER.addHandler(logging.StreamHandler())