code_junkie

Does an application-wide exception handler make sense?

Nov 11th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def main():
  2. # TODO: main application entry point
  3. pass
  4.  
  5. def cleanup():
  6. # TODO: release system resources here
  7. pass
  8.  
  9. if __name__ == "__main__":
  10. try:
  11. main()
  12. except:
  13. cleanup()
  14. raise
  15.  
  16. try:
  17. main()
  18. finally:
  19. cleanup()
Add Comment
Please, Sign In to add comment