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 ShlomiRex
Recipients ShlomiRex
Date 2021-09-09.14:35:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1631198150.11.0.821790716144.issue45153@roundup.psfhosted.org>
In-reply-to
Content
When I want to catch multiple types of exceptions naturally 'OR' keyword is used. But it doesn't work. The interpreter doesn't show any error for the syntax, so developer may think it would work.

Small example:

try:
    myfunc()
except ConnectionResetError or ConnectionAbortedError:
    print("foo")
except Exception as e:
    print("bar")

When myfunc() throws 'ConnectionAbortedError' the interpreter enters "bar" block, and not "foo" block.
History
Date User Action Args
2021-09-09 14:35:50ShlomiRexsetrecipients: + ShlomiRex
2021-09-09 14:35:50ShlomiRexsetmessageid: <1631198150.11.0.821790716144.issue45153@roundup.psfhosted.org>
2021-09-09 14:35:50ShlomiRexlinkissue45153 messages
2021-09-09 14:35:50ShlomiRexcreate