Skip to content

Files

Latest commit

 

History

History
34 lines (22 loc) · 404 Bytes

overlapping-except.md

File metadata and controls

34 lines (22 loc) · 404 Bytes

Pattern: Overlapping exception

Issue: -

Description

Used when exceptions in handler overlap or are identical.

Example of incorrect code:

class SomeException(Exception):
    pass


try:
    pass
except (SomeException, SomeException):
    pass

Example of correct code:

class SomeException(Exception):
    pass


try:
    pass
except (SomeException):
    pass