Weird exception in my, um, exception class constructor
Paul Hankin
paul.hankin at gmail.com
Tue May 27 16:35:14 EDT 2008
On May 27, 9:21 pm, "Joel Koltner" <zapwireDASHgro... at yahoo.com>
wrote:
> I have a generic (do nothing) exception class that's coded like this:
>
> class MyError(exceptions.Exception):
> def __init__(self,args=None):
> self.args = args
>
> When I attempt to raise this exception via 'raise MyError' I get an exception
> within the MyError constructor __init__ as follows:
>
> Traceback (most recent call last):
> [lines deleted]
> File "c:\Documents and Settings\Joel.Kolstad\My Documents\Python\
> MyStuff.py", line 7, in __init__
> self.args = args
> TypeError: 'NoneType' object is not iterable
>
> Ummm... why should 'args' have to be iterable anyway? I don't understand
> what's going on here? Could someone help me with this?
Did you actually write self,args = args?
--
Paul Hankin
More information about the Python-list
mailing list