Permalink
Browse files

Fix canFindBuiltinHeaders if index.parse fails.

  • Loading branch information...
1 parent d429495 commit 16e5cefc44d6a1d15e72181b2606cd9b0e869669 @Rip-Rip committed Mar 18, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 plugin/libclang.py
View
@@ -12,7 +12,10 @@
def canFindBuiltinHeaders(index, args = []):
flags = 0
currentFile = ("test.c", '#include "stddef.h"')
- tu = index.parse("test.c", args, [currentFile], flags)
+ try:
+ tu = index.parse("test.c", args, [currentFile], flags)
+ except TranslationUnitLoadError, e:
+ return 0
return len(tu.diagnostics) == 0
# Derive path to clang builtin headers.

0 comments on commit 16e5cef

Please sign in to comment.