◐ Shell
clean mode source ↗

Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ on exception instances

With the attached patch and -3 option:

>>> Exception(1,2,3)[0]
__main__:1: DeprecationWarning: In 3.x, __getitem__ is not supported for 
exception classes, use args attribute
1
>>> Exception(1,2,3)[:]
__main__:1: DeprecationWarning: In 3.x, __getslice__ is not supported 
for exception classes, use args attribute
(1, 2, 3)