Using finally clauses. : Exception finally : Exception PYTHON examples


PYTHON examples » Exception » Exception finally »

 

Using finally clauses.


Using finally clauses.

def raiseExceptionDoNotCatch():
   try:
      print "In raiseExceptionDoNotCatch"
      raise Exception
   finally:
      print "Finally executed in raiseExceptionDoNotCatch"

   print "Will never reach this point"

print "nCalling raiseExceptionDoNotCatch"

try:
   raiseExceptionDoNotCatch()
except Exception:
   print "Caught exception from raiseExceptionDoNotCatch in main program."

           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Exception
» Exception finally