Kent and Paul, Thanks very much for your help!
On Mon, May 19, 2008 at 8:43 AM, Paul McGuire <[EMAIL PROTECTED]> wrote:
> >>
> Hi - I wrote a custom exception class as follows:
>
> class CustomError(Exception):
>def __init__(self, msg):
>super(CustomError
>>
Hi - I wrote a custom exception class as follows:
class CustomError(Exception):
def __init__(self, msg):
super(CustomError, self).__init__(self, msg)
But this doesn't work as expected:
>>
Correct use of super would be:
class
On Mon, May 19, 2008 at 3:27 AM, wcyee <[EMAIL PROTECTED]> wrote:
> Hi - I wrote a custom exception class as follows:
>
> class CustomError(Exception):
> def __init__(self, msg):
> super(CustomError, self).__init__(self, msg)
Should be
super(CustomError, self).__init__(msg)
i.e. don'
Hi - I wrote a custom exception class as follows:
class CustomError(Exception):
def __init__(self, msg):
super(CustomError, self).__init__(self, msg)
But this doesn't work as expected:
try:
raise CustomError('something bad')
except CustomError, err:
print err.message
err.mes