mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
Python: Only alert on Python 2 code
since - Python 3 is ok from 3.7 onwards - support for Python 3.6 was just dropped - we do not actually know the minor version of the analysed code (only of the extractor)
This commit is contained in:
@@ -67,13 +67,10 @@ where
|
||||
call.getNode().getScope().(Function).isGenerator() and
|
||||
not exists(Comp comp | comp.contains(call.getNode())) and
|
||||
not stop_iteration_handled(call) and
|
||||
// PEP 479 removes this concern from 3.5 onwards
|
||||
// PEP 479 removes this concern from 3.7 onwards
|
||||
// see: https://peps.python.org/pep-0479/
|
||||
//
|
||||
// However, testing it out, the problem is not removed until 3.7.
|
||||
(
|
||||
major_version() = 2
|
||||
or
|
||||
major_version() = 3 and minor_version() < 7
|
||||
)
|
||||
// However, we do not know the minor version of the analysed code (only of the extractor),
|
||||
// so we only alert on Python 2.
|
||||
major_version() = 2
|
||||
select call, "Call to next() in a generator"
|
||||
|
||||
Reference in New Issue
Block a user