Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Crash with preview style fix_fmt_skip_in_one_liners for certain compound statements #4782

@dylwil3

Description

@dylwil3

Playground example below, but also reproduces with async with and if statements with compound boolean conditions (so perhaps related to #4731 but a priori does is not quite the same situation).

Black 314f8c

Playground link

Options

--line-length=88
--safe
--preview

Input

with open("file.txt") as f: content = f.read() # fmt: skip

Output

Cannot parse: 1:4: with

Expected

with open("file.txt") as f: content = f.read() # fmt: skip

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: crashBlack is crashingF: fmtskipfmt: skip implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions