Skip to content

Commit 06f0947

Browse files
Update python/ql/src/Exceptions/UnguardedNextInGenerator.ql
Co-Authored-By: Rasmus Wriedt Larsen <[email protected]>
1 parent 9560c80 commit 06f0947

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/ql/src/Exceptions/UnguardedNextInGenerator.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ predicate call_to_next(CallNode call, ControlFlowNode iter) {
2929
}
3030

3131
predicate call_to_next_has_default(CallNode call) {
32-
exists(call.getArg(1))
32+
exists(call.getArg(1)) or exists(call.getArgByName("default"))
3333
}
3434

3535
predicate guarded_not_empty_sequence(EssaVariable sequence) {
@@ -63,4 +63,3 @@ not exists(Comp comp | comp.contains(call.getNode())) and
6363
not stop_iteration_handled(call)
6464

6565
select call, "Call to next() in a generator"
66-

0 commit comments

Comments
 (0)