Skip to content

Bug in B030: False positive when adding tuples of exception classes #10426

@autinerd

Description

@autinerd

Hello 🙂

When enabling rule B030, these cases are being flagged as violated:

try:
    ...
except (ValueError,TypeError) + (EOFError,ArithmeticError):
    ...
BASE_EXCEPTIONS = (ValueError,TypeError)

try:
    ...
except BASE_EXCEPTIONS + (EOFError,ArithmeticError):
    ...

Ruff version 0.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions