This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dlenski
Recipients dlenski
Date 2017-05-02.19:31:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.7 allows indexing an Exception object to access its args list.

>>> e=Exception('foo','bar','baz')
>>> assert e[0] is e.args[0]

This doesn't work in 3.5:

>>> e=Exception('foo','bar','baz')
>>> e.args[0]
'foo'
>>> e[0]
TypeError: 'Exception' object is not subscriptable

This conversion (e[x] -> e.args[x]) seems like it ought to be fairly straightforward to support in 2to3.
History
Date User Action Args
2017-05-02 19:31:56dlenskisetrecipients: + dlenski
2017-05-02 19:31:56dlenskisetmessageid: <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za>
2017-05-02 19:31:56dlenskilinkissue30238 messages
2017-05-02 19:31:55dlenskicreate