[issue2379] Raise a Py3K warning for __getitem__ or __getslice__ on exception instances
Alexander Belopolsky
report at bugs.python.org
Tue Mar 18 05:00:21 CET 2008
Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:
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)
----------
keywords: +patch
Added file: http://bugs.python.org/file9718/issue2379.diff
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2379>
__________________________________
More information about the Python-bugs-list
mailing list