Remove the ability to slice/index on exceptions per PEP 352.

This commit is contained in:
Brett Cannon 2007-02-27 00:15:55 +00:00
parent 44c526174d
commit ba7bf49a54
8 changed files with 16 additions and 46 deletions

View file

@ -156,7 +156,7 @@ class OtherFileTests(unittest.TestCase):
try:
f = open(TESTFN, bad_mode)
except ValueError as msg:
if msg[0] != 0:
if msg.message != 0:
s = str(msg)
if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
self.fail("bad error message for invalid mode: %s" % s)