Skip to content

Commit 2270c6c

Browse files
committed
Adds modernized files.
1 parent 5269fb7 commit 2270c6c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

python/ql/src/Expressions/HashedButNoHash.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ predicate is_unhashable(ControlFlowNode f, ClassValue cls, ControlFlowNode origi
6969
predicate typeerror_is_caught(ControlFlowNode f) {
7070
exists (Try try |
7171
try.getBody().contains(f.getNode()) and
72-
try.getAHandler().getType().refersTo(theTypeErrorType()))
72+
try.getAHandler().getType().pointsTo(ClassValue::typeErrorType()))
7373
}
7474

7575
from ControlFlowNode f, ClassValue c, ControlFlowNode origin

python/ql/src/semmle/python/objects/ObjectAPI.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,11 @@ module ClassValue {
743743
ClassValue nonetype() {
744744
result = TBuiltinClassObject(Builtin::special("NoneType"))
745745
}
746+
747+
/** Get the `ClassValue` for the `TypeError` class */
748+
ClassValue typeErrorType() {
749+
result = TBuiltinClassObject(Builtin::special("TypeError"))
750+
}
746751

747752
/** Get the `ClassValue` for the `NameError` class. */
748753
ClassValue nameError() {

0 commit comments

Comments
 (0)