]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Tue, 26 May 2020 00:32:18 +0000 (03:32 +0300)
committerGitHub <noreply@github.com>
Tue, 26 May 2020 00:32:18 +0000 (01:32 +0100)
commitf7b1e461567e5e3fa3ba46f589d9edc1b45b2dd0
treeae35c88616222dd863201ea8549ac09c30d9b407
parent2602d97a0ae92b2d320909024e901c202b003e14
bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399)

When a `SyntaxError` in the expression part of a fstring is found,
the filename attribute of the `SyntaxError` is always `<fstring>`.
With this commit, it gets changed to always have the name of the file
the fstring resides in.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_fstring.py
Misc/NEWS.d/next/Core and Builtins/2020-05-25-21-49-11.bpo-38964.lrml90.rst [new file with mode: 0644]
Parser/pegen/parse_string.c