checking if a key is in a dict is done with 'key in dict' not 'hasattr(dict, key)'
This commit is contained in:
parent
71e1b71a03
commit
dad08df71b
@ -75,8 +75,9 @@ class OmniCompleter( Completer ):
|
||||
"')" ]
|
||||
|
||||
items = vim.eval( ''.join( omnifunc_call ) )
|
||||
if hasattr( items, 'words' ):
|
||||
items = items.words
|
||||
|
||||
if 'words' in items:
|
||||
items = items['words']
|
||||
if not hasattr( items, '__iter__' ):
|
||||
raise TypeError( OMNIFUNC_NOT_LIST )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user