◐ Shell
clean mode source ↗

Message 367575 - Python tracker

With Python 3.9.0a6 we get the following syntax error when bytecompiling the standard library in Fedora:


Compiling '/usr/lib64/python3.9/turtledemo/__main__.py'...
***   File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275
    bg="#d00" if clear == NORMAL else"#fca")
                                    ^
SyntaxError: invalid string prefix


I've looked and the bad code is there for all branches, but only with 3.9.0a6 I get the SyntaxError.

I wonder whether this is a know new SyntaxError or not. This "worked" with 3.9.0a5:

>>> "yes" if False else"no"
'no'

Happy to submit a PR for turtledemo.