This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cool-RR
Recipients cool-RR, docs@python
Date 2015-12-10.14:08:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449756500.07.0.727119628461.issue25832@psf.upfronthosting.co.za>
In-reply-to
Content
Today I spent 30 minutes because of weird behavior of `finally` when it has a `break` statement inside of it. (The behavior is that the exception gets suppressed, which I found unexpected.) I think this behavior should be documented.

Example:

    
    
    c:\Users\Administrator\Desktop>cat s.py                    
    for x in [1, 2, 3]:                                        
      try:                                                     
        1/0                                                    
      finally:                                                 
        break                                                  
    print(x)                                                   
                                                              
    c:\Users\Administrator\Desktop>c:\Python34\python.exe s.py 
    1
History
Date User Action Args
2015-12-10 14:08:20cool-RRsetrecipients: + cool-RR, docs@python
2015-12-10 14:08:20cool-RRsetmessageid: <1449756500.07.0.727119628461.issue25832@psf.upfronthosting.co.za>
2015-12-10 14:08:19cool-RRlinkissue25832 messages
2015-12-10 14:08:19cool-RRcreate