mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
python: add version check
and attempt to set version for tests
This commit is contained in:
@@ -66,5 +66,12 @@ where
|
||||
) and
|
||||
call.getNode().getScope().(Function).isGenerator() and
|
||||
not exists(Comp comp | comp.contains(call.getNode())) and
|
||||
not stop_iteration_handled(call)
|
||||
not stop_iteration_handled(call) and
|
||||
// PEP 479 removes this concern from 3.5 onwards
|
||||
// see: https://peps.python.org/pep-0479/
|
||||
(
|
||||
major_version() = 2
|
||||
or
|
||||
major_version() = 3 and minor_version() < 5
|
||||
)
|
||||
select call, "Call to next() in a generator"
|
||||
|
||||
1
python/ql/test/query-tests/Exceptions/generators/options
Normal file
1
python/ql/test/query-tests/Exceptions/generators/options
Normal file
@@ -0,0 +1 @@
|
||||
semmle-extractor-options: --lang=3 --version=3.2
|
||||
Reference in New Issue
Block a user