Skip to content

Formatter: try-except-else comment switches body #5675

@konstin

Description

@konstin

We format

try:
    pass
except X:
    pass
else:
    # comment
    print()

as

try:
    pass
except X:
    pass
    # comment
else:
    print()

even though the comment should rather remain a leading comment of the print statement

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformatterRelated to the formatter

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions