summaryrefslogtreecommitdiff
path: root/test/functional/exception_is_binary_op.py
blob: b9c51d48f08d62eca2abaddf8309ca553e1be9a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
"""Warn about binary operations used as exceptions."""
from __future__ import print_function
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), exc:  # [binary-op-exception]
    print("caught4")