By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,432 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

problem with change to exceptions

P: n/a
import exceptions

class nothing (exceptions.Exception):
def __init__ (self, args=None):
self.args = args

if __name__ == "__main__":
raise nothing

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/tmp/python-3143hDH", line 5, in __init__
self.args = args
TypeError: 'NoneType' object is not iterable

I'll have to say, I don't understand this error.

Jul 27 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Neal Becker <nd*******@gmail.comwrites:
TypeError: 'NoneType' object is not iterable
I'll have to say, I don't understand this error.
It's "lame duck typing". The .args attribute on an Exception instance
is expected to be a tuple of the arguments passed through the raise
statement. It is None if no args were passed.
Jul 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.