Merge pull request #2990 from BekaValentine/python-objectapi-to-valueapi-raisingtuple

Python: ObjectAPI to ValueAPI: RaisingTuple
This commit is contained in:
Taus
2020-03-10 00:16:12 +01:00
committed by GitHub

View File

@@ -11,8 +11,9 @@
import python
from Raise r, AstNode origin
where r.getException().refersTo(_, theTupleType(), 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"