From c9dc1f3ec0bdbb74a61eb6ec14c195a1dae243fe Mon Sep 17 00:00:00 2001 From: cheater Date: Wed, 8 Feb 2012 07:26:38 +0100 Subject: [PATCH] Lame use of exceptions. Never ever use an except block without qualifying the exception type, never ever catch exceptions from multiple sources at once. --- plugin/pythonhelper.vim | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugin/pythonhelper.vim b/plugin/pythonhelper.vim index 8993034..436f68c 100644 --- a/plugin/pythonhelper.vim +++ b/plugin/pythonhelper.vim @@ -659,12 +659,11 @@ def deleteTags(bufferNumber): global TAGS, TAGLINENUMBERS, BUFFERTICKS # try to delete the tags for the buffer {{{ - try: - del TAGS[bufferNumber] - del TAGLINENUMBERS[bufferNumber] - del BUFFERTICKS[bufferNumber] - except: - pass + for o in (TAGS, TAGLINENUMBERS, BUFFERTICKS): + try: + del o[bufferNumber] + except KeyError: + pass # }}} # }}}