blob: 6840d820d777ed0daadce075b0426e9120e20a94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
"""Warn about binary operations used as exceptions."""
try:
pass
except Exception or BaseException: # [binary-op-exception]
print("caught1")
except Exception and BaseException: # [binary-op-exception]
print("caught2")
except Exception or BaseException: # [binary-op-exception]
print("caught3")
except (Exception or BaseException) as exc: # [binary-op-exception]
print("caught4")
|