We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48ec223 commit ec9063bCopy full SHA for ec9063b
python/ql/test/query-tests/Exceptions/generators/UnguardedNextInGenerator.expected
@@ -1,2 +1,3 @@
1
| test.py:5:15:5:22 | ControlFlowNode for next() | Call to next() in a generator |
2
| test.py:10:20:10:27 | ControlFlowNode for next() | Call to next() in a generator |
3
+| test.py:62:19:62:28 | ControlFlowNode for next() | Call to next() in a generator |
python/ql/test/query-tests/Exceptions/generators/test.py
@@ -53,3 +53,12 @@ def ok5(seq):
53
54
def ok6(seq):
55
yield next(iter([]), default='foo')
56
+
57
+# Handling for multiple exception types, one of which is `StopIteration`
58
+# Reported as a false positive in github/codeql#6227
59
+def ok7(seq, ctx):
60
+ try:
61
+ with ctx:
62
+ yield next(iter)
63
+ except (StopIteration, MemoryError):
64
+ return
0 commit comments