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
Code with assert statements gets turned into non valid python code.
$ cat test_assert.py
assert isinstance(1, int)
$ uncompyle2 test_assert.pyc
raise isinstance(1, int) or AssertionError
$ python test_assert_dis.py
Traceback (most recent call last):
File "test_assert_dis.py", line 1, in
raise isinstance(1, int) or AssertionError
TypeError: exceptions must be old-style classes or derived from BaseException, not bool
The text was updated successfully, but these errors were encountered:
Problem: Due to different matching parser rules, LOAD_ASSERT is getting swallowed by raise- or if-statements, which results in syntactically wrong output or wrong indentation. Solution: LOAD_ASSERT shouldn't be an expression, because it is already handled in "assert" and "assert2" rules. See pull request #24
Code with assert statements gets turned into non valid python code.
$ cat test_assert.py
assert isinstance(1, int)
$ uncompyle2 test_assert.pyc
raise isinstance(1, int) or AssertionError
$ python test_assert_dis.py
Traceback (most recent call last):
File "test_assert_dis.py", line 1, in
raise isinstance(1, int) or AssertionError
TypeError: exceptions must be old-style classes or derived from BaseException, not bool
The text was updated successfully, but these errors were encountered: