From 11a774675380b8b94675608bae861429d2d0f2d0 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Wed, 22 May 2013 15:47:30 -0700 Subject: [PATCH] Preventing possible TypeError with StringVec It was possible to get a traceback if results[ 'flags' ] was a StringVec; the code would try to perform results[ 'flags' ] += self.special_clang_flags and this would then fail because the clang flags would be a Python list. --- python/ycm/completers/cpp/flags.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/ycm/completers/cpp/flags.py b/python/ycm/completers/cpp/flags.py index 5b0b76cd..2847752c 100644 --- a/python/ycm/completers/cpp/flags.py +++ b/python/ycm/completers/cpp/flags.py @@ -55,9 +55,10 @@ class Flags( object ): if not results.get( 'flags_ready', True ): return None + flags = list( results[ 'flags' ] ) if add_special_clang_flags: - results[ 'flags' ] += self.special_clang_flags - sanitized_flags = _PrepareFlagsForClang( results[ 'flags' ], filename ) + flags += self.special_clang_flags + sanitized_flags = _PrepareFlagsForClang( flags, filename ) if results[ 'do_cache' ]: self.flags_for_file[ filename ] = sanitized_flags