Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportFrom can produce invalid code without parenthesis #532

Open
zsol opened this issue Oct 16, 2021 · 0 comments · May be fixed by #869
Open

ImportFrom can produce invalid code without parenthesis #532

zsol opened this issue Oct 16, 2021 · 0 comments · May be fixed by #869
Labels
bug Something isn't working parsing Converting source code into CST nodes

Comments

@zsol
Copy link
Member

zsol commented Oct 16, 2021

In fact this is captured as a test case in https://github.com/instagram/libcst/blob/f36eacb1327830fad51e08084b46601cad681ae0/libcst/_nodes/tests/test_import.py#L394-L401

cst.ImportFrom(
    module=cst.Name("foo"),
    names=(
        cst.ImportAlias(cst.Name("bar"), comma=cst.Comma()),
        cst.ImportAlias(cst.Name("baz"), comma=cst.Comma()),
    ),
)

This node generates from foo import bar,baz, which isn't syntactically correct.

@zsol zsol added the bug Something isn't working label Oct 16, 2021
@zsol zsol added the parsing Converting source code into CST nodes label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parsing Converting source code into CST nodes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant