S
Steven Woody
Hi,
I am trying define an Exception as below:
class MyError(Exception):
def __init__(self, message):
self.message = message
And, I expect that when I raise a MyError as
raise MyError, "my message"
the python should print a line such as
MyError: my message
But I did not get that, I just got:
...
MyError
I guess I had made something wrong with the __init__() definition, but
I can not find an answer in doc. Please help, thanks!
-
narke
I am trying define an Exception as below:
class MyError(Exception):
def __init__(self, message):
self.message = message
And, I expect that when I raise a MyError as
raise MyError, "my message"
the python should print a line such as
MyError: my message
But I did not get that, I just got:
...
MyError
I guess I had made something wrong with the __init__() definition, but
I can not find an answer in doc. Please help, thanks!
-
narke