From 1c80d84e9cc4d0d26edacbe354ad204192ca6332 Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Wed, 19 Jun 2013 18:12:12 +0800 Subject: [PATCH] fix Out of Code detetction indexerror --- UltiSnips/rst.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UltiSnips/rst.snippets b/UltiSnips/rst.snippets index ec11b7f..ea70d81 100644 --- a/UltiSnips/rst.snippets +++ b/UltiSnips/rst.snippets @@ -99,7 +99,7 @@ def find_all_code_type(path): types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', source.read()) try: popular_type = Counter(types).most_common()[0][0] - except KeyError: + except IndexError: popular_type = "lua" # Don't break default return popular_type