Skip to content

Files

Latest commit

 

History

History
17 lines (11 loc) · 396 Bytes

wrong-exception-operation.md

File metadata and controls

17 lines (11 loc) · 396 Bytes

Pattern: Invalid exception operation

Issue: -

Description

Used when an operation is done against an exception, but the operation is not valid for the exception in question. Usually emitted when having binary operations between exceptions in except handlers.

Example of incorrect code:

try:
    1/0
except (ValueError | TypeError): # [wrong-exception-operation]
    pass