Backport of fix to allow exception instances to be sliced once again.
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 27d88a0..345569f 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -279,6 +279,13 @@
'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