diff options
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, |