Permalink
Browse files

A NULL pointer returned by libclang shouldn't be compared against None.

This fix #299.
  • Loading branch information...
1 parent d14eb87 commit fbbab605fff9d0d8453f0099da486dac6e74fbdf @Rip-Rip committed Mar 16, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 plugin/clang/cindex.py
View
@@ -2015,7 +2015,7 @@ def from_source(cls, filename, args=None, unsaved_files=None, options=0,
len(args), unsaved_array,
len(unsaved_files), options)
- if ptr is None:
+ if not ptr:
raise TranslationUnitLoadError("Error parsing translation unit.")
return cls(ptr, index=index)
@@ -2037,7 +2037,7 @@ def from_ast_file(cls, filename, index=None):
index = Index.create()
ptr = conf.lib.clang_createTranslationUnit(index, filename)
- if ptr is None:
+ if not ptr:
raise TranslationUnitLoadError(filename)
return cls(ptr=ptr, index=index)

0 comments on commit fbbab60

Please sign in to comment.