mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Make test for wrong bool type pass
This commit is contained in:
@@ -116,6 +116,8 @@ predicate preferred_raise(string name, ClassObject ex) {
|
||||
ordering_method(name) and ex = theTypeErrorType()
|
||||
or
|
||||
arithmetic_method(name) and ex = Object::builtin("ArithmeticError")
|
||||
or
|
||||
name = "__bool__" and ex = theTypeErrorType()
|
||||
}
|
||||
|
||||
predicate no_need_to_raise(string name, string message) {
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
| protocols.py:98:5:98:33 | Function __getitem__ | Function always raises $@; raise LookupError instead | file://:Compiled Code:0:0:0:0 | builtin-class ZeroDivisionError | builtin-class ZeroDivisionError |
|
||||
| protocols.py:101:5:101:26 | Function __getattr__ | Function always raises $@; raise AttributeError instead | file://:Compiled Code:0:0:0:0 | builtin-class ZeroDivisionError | builtin-class ZeroDivisionError |
|
||||
| protocols.py:124:5:124:23 | Function __bool__ | Function always raises $@; raise TypeError instead | file://:Compiled Code:0:0:0:0 | builtin-class ZeroDivisionError | builtin-class ZeroDivisionError |
|
||||
|
||||
Reference in New Issue
Block a user