Skip to content

Commit 6d10c47

Browse files
committed
Python: Moves predicates over to suffixed form
1 parent 02ae0fb commit 6d10c47

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

python/ql/src/Exceptions/IllegalExceptionHandlerType.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import python
1515

1616
from ExceptFlowNode ex, Object t, ClassObject c, ControlFlowNode origin, string what
17-
where ex.handledException(t, c, origin) and
17+
where ex.handledException_objectapi(t, c, origin) and
1818
(
1919
exists(ClassObject x | x = t |
2020
not x.isLegalExceptionType() and

python/ql/src/semmle/python/types/Exceptions.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class ExceptFlowNode extends ControlFlowNode {
271271

272272
/** Gets the inferred type(s) that are handled by this node, splitting tuples if possible. */
273273
pragma [noinline]
274-
predicate handledException(Object obj, ClassObject cls, ControlFlowNode origin) {
274+
predicate handledException_objectapi(Object obj, ClassObject cls, ControlFlowNode origin) {
275275
this.handledObject(obj, cls, origin) and not cls = theTupleType()
276276
or
277277
not exists(this.getNode().(ExceptStmt).getType()) and obj = theBaseExceptionType() and cls = theTypeType() and
@@ -281,7 +281,7 @@ class ExceptFlowNode extends ControlFlowNode {
281281
/** Whether this `except` handles `cls` */
282282
predicate handles(ClassObject cls) {
283283
exists(ClassObject handled |
284-
this.handledException(handled, _, _) |
284+
this.handledException_objectapi(handled, _, _) |
285285
cls.getAnImproperSuperType() = handled
286286
)
287287
}

python/ql/test/2/library-tests/ControlFlow/Exceptions/Handles.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
import python
33

44
from ExceptFlowNode ex, Object obj
5-
where ex.handledException(obj, _, _)
5+
where ex.handledException_objectapi(obj, _, _)
66
select ex.getLocation().getStartLine(), ex.toString(), obj.toString()

python/ql/test/3/library-tests/ControlFlow/Exceptions/Handles.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
import python
33

44
from ExceptFlowNode ex, Object obj
5-
where ex.handledException(obj, _, _)
5+
where ex.handledException_objectapi(obj, _, _)
66
select ex.getLocation().getStartLine(), ex.toString(), obj.toString()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import python
22

33
from ExceptFlowNode ex, Object t
4-
where ex.handledException(t, _, _)
4+
where ex.handledException_objectapi(t, _, _)
55
select ex.getLocation().getStartLine(), ex.toString(), t.toString()

0 commit comments

Comments
 (0)