Python: Modernise py/loop-variable-capture

This commit is contained in:
Rasmus Wriedt Larsen
2019-12-12 14:52:23 +01:00
parent 5cea452123
commit 6a73479ea3

View File

@@ -34,7 +34,7 @@ predicate escaping_capturing_looping_construct(CallableExpr capturing, AstNode l
and
// Escapes if used out side of for loop or is a lambda in a comprehension
(
exists(Expr e, For forloop | forloop = loop and e.refersTo(_, _, capturing) | not forloop.contains(e))
exists(Expr e, For forloop | forloop = loop and e.pointsTo(_, _, capturing) | not forloop.contains(e))
or
loop.(Comp).getElt() = capturing
or