T
Thorsten Kampe
What is the best way to except two errors, when the except handling in
both cases is the same?
"except:" would just except every error and not just those I want.
except Attribute error:
do_much_stuff
except TypeError:
do_the_same_stuff
is bad because of the duplication and
def do_it():
do_much_stuff
except Attribute error:
do_it()
except TypeError:
do_it()
would work but is rather unelegant? What is the best way to except to
errors with the same exception handling?
Thorsten
both cases is the same?
"except:" would just except every error and not just those I want.
except Attribute error:
do_much_stuff
except TypeError:
do_the_same_stuff
is bad because of the duplication and
def do_it():
do_much_stuff
except Attribute error:
do_it()
except TypeError:
do_it()
would work but is rather unelegant? What is the best way to except to
errors with the same exception handling?
Thorsten