Instagram / Instagram/LibCST

Cannot use except without parentheses

Open
#1,443 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

#1344 Was closed, but libcst is still raising a `ParserSyntaxError` when using `except` without parentheses.

Example:
```python
import ast, libcst

block = """try:
pass
except A, B, C:
pass"""

ast.parse(block) # Module(...)

libcst.parse_module(block) # Error!
```

This raises
```python
libcst._exceptions.ParserSyntaxError: Syntax Error @ 4:7.
parser error: error at 3:10: expected one of !=, %, &, (, *, **, +, -, ., /, //, :, <, <<, <=, ==, >, >=, >>, @, [, ^, and, as, if, in, is, not, or, |

pass
^
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.