Fix overrides in Python-3

With bytes() keys they were not working well since in Python-3 bytes() is not
comparable with str().
This commit is contained in:
ZyX 2014-09-14 15:58:34 +04:00
parent af170eca13
commit 8417fd25e2
1 changed files with 4 additions and 1 deletions

View File

@ -132,7 +132,10 @@ _getbufvar = vim_get_func('getbufvar')
if hasattr(vim, 'vvars') and vim.vvars['version'] > 703: if hasattr(vim, 'vvars') and vim.vvars['version'] > 703:
_vim_to_python_types = { _vim_to_python_types = {
getattr(vim, 'Dictionary', None) or type(vim.bindeval('{}')): getattr(vim, 'Dictionary', None) or type(vim.bindeval('{}')):
lambda value: dict(((key, _vim_to_python(value[key])) for key in value.keys())), lambda value: dict((
(_vim_to_python(k), _vim_to_python(v))
for k, v in value.items()
)),
getattr(vim, 'List', None) or type(vim.bindeval('[]')): getattr(vim, 'List', None) or type(vim.bindeval('[]')):
lambda value: [_vim_to_python(item) for item in value], lambda value: [_vim_to_python(item) for item in value],
getattr(vim, 'Function', None) or type(vim.bindeval('function("mode")')): getattr(vim, 'Function', None) or type(vim.bindeval('function("mode")')):