classification
Title: Raise a Py3K warning for __getitem__ or __getslice__ on exception instances
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: belopolsky, gvanrossum
Priority: release blocker Keywords: patch

Created on 2008-03-18 03:15 by belopolsky, last changed 2008-03-18 04:43 by gvanrossum. This issue is now closed.

Files
File name Uploaded Description Edit
issue2379.diff belopolsky, 2008-03-18 04:00
Messages (4)
msg63864 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2008-03-18 03:15
As requested by Guido at msg63858. Will create a patch.
msg63877 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2008-03-18 04:00
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)
msg63880 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-03-18 04:04
I'll review this soon.
msg63885 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-03-18 04:43
Cleaned up and committed as r61489.

Thanks!!
History
Date User Action Args
2008-03-18 04:43:06gvanrossumsetstatus: open -> closed
resolution: accepted
messages: + msg63885
2008-03-18 04:04:18gvanrossumsetpriority: release blocker
assignee: gvanrossum
messages: + msg63880
nosy: + gvanrossum
2008-03-18 04:00:20belopolskysetfiles: + issue2379.diff
keywords: + patch
messages: + msg63877
2008-03-18 03:15:37belopolskycreate