Python: Fixes bug in modernization

This commit is contained in:
Rebecca Valentine
2020-03-06 12:47:46 -08:00
parent 646bc29e76
commit 7b49c8e6f8

View File

@@ -11,8 +11,9 @@
import python
from Raise r, AstNode origin
where r.getException().pointsTo(_, ClassValue::tuple(), origin) and
from Raise r, Value v, AstNode origin
where r.getException().pointsTo(v, origin) and
v.getClass() = ClassValue::tuple() and
major_version() = 2 /* Raising a tuple is a type error in Python 3, so is handled by the IllegalRaise query. */
select r, "Raising $@ will result in the first element (recursively) being raised and all other elements being discarded.", origin, "a tuple"