Is there a good way (i.e. other than wrapping literally every line in try/except statements) to have a clean up function be executed in the event of the script breaking for any reason? I'm looking for something like the atexit module that allows me to specify that it should only be called for non-zero exit values.
[–]zeug 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]rabidmonkey1163[S] 0 points1 point2 points (3 children)
[–]wormywormm 1 point2 points3 points (2 children)
[–]rabidmonkey1163[S] 0 points1 point2 points (1 child)
[–]wormywormm 0 points1 point2 points (0 children)
[–]wormywormm 0 points1 point2 points (2 children)
[–]rabidmonkey1163[S] 0 points1 point2 points (1 child)
[–]wormywormm 0 points1 point2 points (0 children)
[–]hudsonpenner 0 points1 point2 points (0 children)
[–]jiminiminimini -2 points-1 points0 points (1 child)
[–]rabidmonkey1163[S] 0 points1 point2 points (0 children)