Skip to content

Commit 9e79e1b

Browse files
Simplify the logic with theTypeErrorType().
1 parent 56efe3a commit 9e79e1b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/ql/src/Expressions/HashedButNoHash.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ predicate is_unhashable(ControlFlowNode f, ClassObject cls, ControlFlowNode orig
6565
* it.
6666
*/
6767
predicate typeerror_is_caught(ControlFlowNode f) {
68-
exists (Try try, CheckClass c |
68+
exists (Try try |
6969
try.getBody().contains(f.getNode()) and
70-
c.getName() = "TypeError" and
71-
try.getAHandler().getType().refersTo(c))
70+
try.getAHandler().getType().refersTo(theTypeErrorType()))
7271
}
7372

7473
from ControlFlowNode f, ClassObject c, ControlFlowNode origin

0 commit comments

Comments
 (0)