diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2012-02-23 09:26:58 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2012-02-23 09:26:58 +0100 |
commit | d1ae21960ac1b39f9b6100ac5c790af30236edac (patch) | |
tree | 0f53e45838cf60d445ca0ae19497fea3f54c475b | |
parent | 7e1cf48f5e089d051405612e0add7e4c8abccae8 (diff) | |
download | pylint-git-d1ae21960ac1b39f9b6100ac5c790af30236edac.tar.gz |
InferenceError may be raised when running the next iteration, but we don't want it to propagate
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | checkers/utils.py | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -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 |