mirror of
https://github.com/github/codeql.git
synced 2025-12-21 03:06:31 +01:00
Merge pull request #10264 from yoff/python/port-RaisesTuple
Approved by tausbn
This commit is contained in:
@@ -10,11 +10,14 @@
|
||||
*/
|
||||
|
||||
import python
|
||||
import semmle.python.dataflow.new.DataFlow
|
||||
|
||||
from Raise r, Value v, AstNode origin
|
||||
from Raise r, DataFlow::LocalSourceNode origin
|
||||
where
|
||||
r.getException().pointsTo(v, origin) and
|
||||
v.getClass() = ClassValue::tuple() and
|
||||
exists(DataFlow::Node exception | exception.asExpr() = r.getException() |
|
||||
origin.flowsTo(exception)
|
||||
) and
|
||||
origin.asExpr() instanceof Tuple and
|
||||
major_version() = 2
|
||||
/* Raising a tuple is a type error in Python 3, so is handled by the IllegalRaise query. */
|
||||
select r,
|
||||
|
||||
Reference in New Issue
Block a user