InferenceError may be raised when running the next iteration, but we don't want it to propagate

authorSylvain Th?nault <sylvain.thenault@logilab.fr>
changesetc6cbb867a882
branchdefault
phasepublic
hiddenno
parent revision#65a5679e8a94 d-t-w
child revision#b0f72604a2d7 don't emit E0202 (attribute hiding a method) on @property methods. Closes #89092
files modified by this revision
ChangeLog
checkers/utils.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1329985618 -3600
# Thu Feb 23 09:26:58 2012 +0100
# Node ID c6cbb867a88238fdfd19c8bdf19ebcf4953067fd
# Parent 65a5679e8a94cd74a9f91a20b7f1897244d30496
InferenceError may be raised when running the next iteration, but we don't want it to propagate

diff --git a/ChangeLog b/ChangeLog
@@ -3,10 +3,11 @@
1 
2  	--
3 
4      * #87192 fix crash when decorators are accessed through more than one dot
5        (for instance @a.b is fine, @a.b.c crash)
6 +    * fix potential crashes with utils.safe_infer raising InferenceError
7 
8  2011-12-08  --  0.25.1
9      * #81078: Warn if names in  exception handlers clobber overwrite
10        existing names (patch by tmarek@google.com)
11 
diff --git a/checkers/utils.py b/checkers/utils.py
@@ -63,10 +63,12 @@
12      except astng.InferenceError:
13          return
14      try:
15          inferit.next()
16          return # None if there is ambiguity on the inferred node
17 +    except astng.InferenceError:
18 +        return # there is some kind of ambiguity
19      except StopIteration:
20          return value
21 
22  def is_super(node):
23      """return True if the node is referencing the "super" builtin function