Skip to content

[3.9] bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399)#20404

Merged
pablogsal merged 1 commit into
python:3.9from
lysnikolaou:backport-f7b1e46-3.9
May 26, 2020
Merged

[3.9] bpo-38964: Print correct filename on a SyntaxError in an fstring (GH-20399)#20404
pablogsal merged 1 commit into
python:3.9from
lysnikolaou:backport-f7b1e46-3.9

Conversation

@lysnikolaou

@lysnikolaou lysnikolaou commented May 26, 2020

Copy link
Copy Markdown
Member

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.
(cherry picked from commit f7b1e46)

Co-authored-by: Lysandros Nikolaou lisandrosnik@gmail.com

https://bugs.python.org/issue38964

pythonGH-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>.
(cherry picked from commit f7b1e46)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@lysnikolaou

Copy link
Copy Markdown
Member Author

Closing and reopening for the CI to re-run.

@lysnikolaou lysnikolaou reopened this May 26, 2020
@pablogsal
pablogsal merged commit 791a46e into python:3.9 May 26, 2020
@lysnikolaou
lysnikolaou deleted the backport-f7b1e46-3.9 branch May 27, 2020 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants