ask help about raise, thank u
Emile van Sebille
emile at fenx.com
Tue Feb 26 08:48:27 EST 2002
More information about the Python-list mailing list
Tue Feb 26 08:48:27 EST 2002
- Previous message (by thread): Calling baseclass method from a derivated class
- Next message (by thread): ask help about raise, thank u
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"John Machin" > # re-raise the exception, with traceback giving the *original* > # source of the problem (somewhere inside the 'try' suite), > # not the 'raise' statement > raise exc, data, tb > Isn't this what raise by itself does? >>> def test(d=None): ... try: ... 1/d ... except TypeError: ... return 0 ... except: ... raise ... >>> test() 0 >>> test(0) Traceback (most recent call last): File "<stdin>", line 1, in ? File "<stdin>", line 3, in test ZeroDivisionError: integer division or modulo by zero >>> -- Emile van Sebille emile at fenx.com ---------
- Previous message (by thread): Calling baseclass method from a derivated class
- Next message (by thread): ask help about raise, thank u
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list