diff options
author | Zac Medico <zmedico@gentoo.org> | 2013-01-18 15:05:42 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2013-01-18 15:05:42 -0800 |
commit | e9a04922c144b267534e3335d2ff3d7bb8994b80 (patch) | |
tree | 0c43dc33336066103b605bc7441ac94bc85575b9 /pym/portage/__init__.py | |
parent | 71235479ab208318dff391420f9695f5cfaa9594 (diff) | |
download | portage-e9a04922c144b267534e3335d2ff3d7bb8994b80.tar.gz portage-e9a04922c144b267534e3335d2ff3d7bb8994b80.tar.bz2 portage-e9a04922c144b267534e3335d2ff3d7bb8994b80.zip |
Add workaround for Python 2.6.4 issue 4978
Avoid "TypeError: keywords must be strings" issue triggered
by unicode_literals: http://bugs.python.org/issue4978
Diffstat (limited to 'pym/portage/__init__.py')
-rw-r--r-- | pym/portage/__init__.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 3bae4deff..94ca7b90f 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -198,6 +198,15 @@ else: _native_string = _unicode_encode +if sys.hexversion >= 0x20605f0: + def _native_kwargs(kwargs): + return kwargs +else: + # Avoid "TypeError: keywords must be strings" issue triggered + # by unicode_literals: http://bugs.python.org/issue4978 + def _native_kwargs(kwargs): + return dict((_native_string(k), v) for k, v in kwargs.iteritems()) + class _unicode_func_wrapper(object): """ Wraps a function, converts arguments from unicode to bytes, |