From dad08df71b747255fdfdf868d1c506d11441982b Mon Sep 17 00:00:00 2001 From: Thomas Refis Date: Sat, 13 Apr 2013 14:26:21 +0200 Subject: [PATCH] checking if a key is in a dict is done with 'key in dict' not 'hasattr(dict, key)' --- python/completers/all/omni_completer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/completers/all/omni_completer.py b/python/completers/all/omni_completer.py index 2c8f93be..abea1d8d 100644 --- a/python/completers/all/omni_completer.py +++ b/python/completers/all/omni_completer.py @@ -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 )