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 dmitry_koshelev
Recipients dmitry_koshelev
Date 2019-02-06.16:18:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549469917.09.0.661318828546.issue35916@roundup.psfhosted.org>
In-reply-to
Content
Hello dear developer!
I was playing with try/else/finally block and have found a bug:

Inside of "else" or/and "except" I can do this 
  1 + print('Why do you print me?') + 1
this would print "Why do you print me?", 
in case if I have "finally" block with a "return" statement, no error raises,
if I don't have finally, nothing is printed.

def foo(var):
  try:
    print("Hello")
    # 1 + print("Hello")
    except:
      1 + print('Why do you print me?') + 1
    else:
      1 + print('Why do you print me?') + 1
    finally:
      print("finally block")
      return
History
Date User Action Args
2019-02-06 16:18:40dmitry_koshelevsetrecipients: + dmitry_koshelev
2019-02-06 16:18:37dmitry_koshelevsetmessageid: <1549469917.09.0.661318828546.issue35916@roundup.psfhosted.org>
2019-02-06 16:18:37dmitry_koshelevlinkissue35916 messages
2019-02-06 16:18:36dmitry_koshelevcreate