Skip to content

Commit c9c469b

Browse files
committed
Python: Modernizes queries
1 parent 6a1203a commit c9c469b

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

python/ql/src/Exceptions/IllegalExceptionHandlerType.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313

1414
import python
1515

16-
from ExceptFlowNode ex, Object t, ClassObject c, ControlFlowNode origin, string what
17-
where ex.handledException_objectapi(t, c, origin) and
16+
from ExceptFlowNode ex, Value t, ClassValue c, ControlFlowNode origin, string what
17+
where ex.handledException(t, c, origin) and
1818
(
19-
exists(ClassObject x | x = t |
19+
exists(ClassValue x | x = t |
2020
not x.isLegalExceptionType() and
21-
not x.failedInference() and
21+
not x.failedInference(_) and
2222
what = "class '" + x.getName() + "'"
2323
)
2424
or
25-
not t instanceof ClassObject and
25+
not t instanceof ClassValue and
2626
what = "instance of '" + c.getName() + "'"
2727
)
2828

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import python
33

4-
from ExceptFlowNode ex, Object obj
5-
where ex.handledException_objectapi(obj, _, _)
6-
select ex.getLocation().getStartLine(), ex.toString(), obj.toString()
4+
from ExceptFlowNode ex, Value val
5+
where ex.handledException(val, _, _)
6+
select ex.getLocation().getStartLine(), ex.toString(), val.toString()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import python
33

4-
from ExceptFlowNode ex, Object obj
5-
where ex.handledException_objectapi(obj, _, _)
6-
select ex.getLocation().getStartLine(), ex.toString(), obj.toString()
4+
from ExceptFlowNode ex, Value val
5+
where ex.handledException(val, _, _)
6+
select ex.getLocation().getStartLine(), ex.toString(), val.toString()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import python
22

3-
from ExceptFlowNode ex, Object t
4-
where ex.handledException_objectapi(t, _, _)
5-
select ex.getLocation().getStartLine(), ex.toString(), t.toString()
3+
from ExceptFlowNode ex, Value val
4+
where ex.handledException(val, _, _)
5+
select ex.getLocation().getStartLine(), ex.toString(), val.toString()

0 commit comments

Comments
 (0)