summaryrefslogtreecommitdiff
path: root/test/functional/exception_is_binary_op.py
blob: 443a4780bd701ac18148674afd0c4e931fa97aa0 (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 StandardError:  # [binary-op-exception]
    print "caught1"
except Exception and StandardError:  # [binary-op-exception]
    print "caught2"
except Exception or StandardError:  # [binary-op-exception]
    print "caught3"
except (Exception or StandardError), exc:  # [binary-op-exception]
    print "caught4"