Skip to content

SystemExit and sys.exit behavior overlap #1786

@thecnoNSMB

Description

@thecnoNSMB

Rule request

raise SystemExit(arg) and sys.exit(arg) are identical in behavior, one should be favored over the other for consistency.

Reasoning

I don't know which of the two would be preferable for this linter (I suspect sys.exit(arg), but raise SystemExit(arg) doesn't require any imports), but several other contexts where multiple forms are valid have a rule enforcing one form as the standard (such as single vs double quotes, or string formatting methods), and I figure the same logic should apply here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions