brython-dev / brython

Brython (Browser Python) is an implementation of Python 3 running in the browser
BSD 3-Clause "New" or "Revised" License
6.4k stars 512 forks source link

Error for empty 'assert' statement inconsistent with CPython #2511

Open PhilipD8 opened 3 weeks ago

PhilipD8 commented 3 weeks ago

This code block

from cmu_cpcs_utils import testFunction

@testFunction
def test():
    assert

test()

when run in CPython 3.11, prints SyntaxError: invalid syntax

and when run on master Brython, prints Exception: <Javascript TypeError>: this.tree[0].ast is not a function

Thanks again for taking a look! :)

PierreQuentel commented 3 weeks ago

Sorry, I can't reproduce the issue, the error message is correct with Brython 3.13.0. Which version are you using ?