You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importlibcstlibcst.parse_module('() if 0 else(lambda:())')
Raises the following error:
Traceback (most recent call last):
File "/root/cstbreaker.py", line 5, in <module>
libcst.parse_module('() if 0 else(lambda:())')
File "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/libcst/_parser/entrypoints.py", line 109, in parse_module
result = _parse(
^^^^^^^
File "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/libcst/_parser/entrypoints.py", line 55, in _parse
return parse(source_str)
^^^^^^^^^^^^^^^^^
File "<string>", line 12, in __init__
File "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/libcst/_nodes/base.py", line 117, in __post_init__
self._validate()
File "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/libcst/_nodes/expression.py", line 2553, in _validate
and not self.orelse._safe_to_use_with_word_operator(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/libcst/_nodes/expression.py", line 2115, in _safe_to_use_with_word_operator
return super()._safe_to_use_with_word_operator(position)
This example is sensitive to whitespace. For example, inserting a space between the else and the opening bracket causes it to start working (or at least not crash, I've not checked if the parse is correct).
This is running with libcst 1.1.0 on Python 3.11.6
The text was updated successfully, but these errors were encountered:
The following code:
Raises the following error:
This example is sensitive to whitespace. For example, inserting a space between the
else
and the opening bracket causes it to start working (or at least not crash, I've not checked if the parse is correct).This is running with libcst 1.1.0 on Python 3.11.6
The text was updated successfully, but these errors were encountered: