mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Remove the ability to slice/index on exceptions per PEP 352.
This commit is contained in:
parent
44c526174d
commit
ba7bf49a54
8 changed files with 16 additions and 46 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue