Open
Description
Description of the false positive
Same as #2206. Except the reproducer contains several subsequent suppress()
es:
import contextlib
def some_func():
with contextlib.suppress(KeyError):
return dict()['a_key']
with contextlib.suppress(KeyError): # LGTM complains that it's unreachable
return dict()['b_key']
with contextlib.suppress(KeyError):
return dict()['c_key']
return 'fallback'
So I guess #2078 needs more test cases maybe...
URL to the alert on the project page on LGTM.com