akonsu wrote:
hello,
my script creates files that i need to delete if an exception is
thrown.
is this a good pythonic style to do this kind of cleanup in
sys.excepthook instead of inside except clause of a try block?
Speaking personally, I'd do the cleanup in the except clause if they
needed to be deleted only if there was an exception; I'd use a finally
clause or a 'with' context if they always had to be deleted, whether
there was an exception or not.
--
http://mail.python.org/mailman/listinfo/python-list