This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hroncok
Recipients hroncok, petr.viktorin, vstinner
Date 2020-04-28.23:29:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588116558.63.0.121077562738.issue40431@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-04-28 23:29:18hroncoksetrecipients: + hroncok, vstinner, petr.viktorin
2020-04-28 23:29:18hroncoksetmessageid: <1588116558.63.0.121077562738.issue40431@roundup.psfhosted.org>
2020-04-28 23:29:18hroncoklinkissue40431 messages
2020-04-28 23:29:18hroncokcreate