summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2012-02-23 09:26:58 +0100
committerSylvain Thénault <sylvain.thenault@logilab.fr>2012-02-23 09:26:58 +0100
commitd1ae21960ac1b39f9b6100ac5c790af30236edac (patch)
tree0f53e45838cf60d445ca0ae19497fea3f54c475b
parent7e1cf48f5e089d051405612e0add7e4c8abccae8 (diff)
downloadpylint-git-d1ae21960ac1b39f9b6100ac5c790af30236edac.tar.gz
InferenceError may be raised when running the next iteration, but we don't want it to propagate
-rw-r--r--ChangeLog1
-rw-r--r--checkers/utils.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 98d2226c6..e8f1da82e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ ChangeLog for PyLint
* #87192 fix crash when decorators are accessed through more than one dot
(for instance @a.b is fine, @a.b.c crash)
+ * fix potential crashes with utils.safe_infer raising InferenceError
2011-12-08 -- 0.25.1
* #81078: Warn if names in exception handlers clobber overwrite
diff --git a/checkers/utils.py b/checkers/utils.py
index 2883c43ba..95574d4ef 100644
--- a/checkers/utils.py
+++ b/checkers/utils.py
@@ -65,6 +65,8 @@ def safe_infer(node):
try:
inferit.next()
return # None if there is ambiguity on the inferred node
+ except astng.InferenceError:
+ return # there is some kind of ambiguity
except StopIteration:
return value