mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #1877 from taus-semmle/python-modernise-non-iterator-query
Python: Modernise the `py/non-iterable-in-for-loop` query.
This commit is contained in:
2
python/ql/test/3/query-tests/Statements/iter/NonIteratorInForLoop.expected
Executable file → Normal file
2
python/ql/test/3/query-tests/Statements/iter/NonIteratorInForLoop.expected
Executable file → Normal file
@@ -1 +1 @@
|
||||
| statements_test.py:34:5:34:19 | For | $@ of class '$@' may be used in for-loop. | statements_test.py:34:18:34:18 | ControlFlowNode for IntegerLiteral | Non-iterator | file://:Compiled Code:0:0:0:0 | builtin-class int | int |
|
||||
| statements_test.py:34:5:34:19 | For | $@ of class '$@' may be used in for-loop. | statements_test.py:34:18:34:18 | ControlFlowNode for IntegerLiteral | Non-iterator | file://:0:0:0:0 | builtin-class int | int |
|
||||
|
||||
1
python/ql/test/query-tests/Statements/general/NonIteratorInForLoop.expected
Executable file → Normal file
1
python/ql/test/query-tests/Statements/general/NonIteratorInForLoop.expected
Executable file → Normal file
@@ -1 +1,2 @@
|
||||
| test.py:50:1:50:23 | For | $@ of class '$@' may be used in for-loop. | test.py:50:10:50:22 | ControlFlowNode for NonIterator() | Non-iterator | test.py:45:1:45:26 | class NonIterator | NonIterator |
|
||||
| test.py:170:10:170:22 | For | $@ of class '$@' may be used in for-loop. | test.py:170:10:170:22 | ControlFlowNode for .0 | Non-iterator | test.py:169:1:169:21 | class false_positive | false_positive |
|
||||
|
||||
@@ -165,4 +165,7 @@ def no_with():
|
||||
def assert_ok(seq):
|
||||
assert all(isinstance(element, (str, unicode)) for element in seq)
|
||||
|
||||
# False positive. ODASA-8042
|
||||
class false_positive:
|
||||
e = (x for x in [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user