Skip to content

Commit 21d1ea5

Browse files
committed
Merge branch 'boolDefault' of github.com:yoff/codeql into boolDefault
2 parents 1817d2a + e5eadf9 commit 21d1ea5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/ql/test/query-tests/Functions/general/protocols.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ def __call__(self):
117117
yield 0
118118
raise StopIteration
119119

120+
# __bool__ returns `True` by default, so raising `TypeError` should not give an alert
121+
# FP reported in https://github.com/github/codeql/issues/2388
120122
def __bool__(self):
121123
raise TypeError
122124

123125
class BadBool(object):
124126
def __bool__(self):
125-
raise ZeroDivisionError()
127+
raise ZeroDivisionError()

0 commit comments

Comments
 (0)