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

@ -302,13 +302,6 @@ class ExceptionTests(unittest.TestCase):
'pickled "%r", attribute "%s' %
(e, checkArgName))
def testSlicing(self):
# Test that you can slice an exception directly instead of requiring
# going through the 'args' attribute.
args = (1, 2, 3)
exc = BaseException(*args)
self.failUnlessEqual(exc[:], args)
def testKeywordArgs(self):
# test that builtin exception don't take keyword args,
# but user-defined subclasses can if they want