镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Use try-catch block in order to handle extracting f-strings - #769

Closed
evonbevern wants to merge 2 commits into
python-babel:masterfrom
evonbevern:master
Closed

evonbevern wants to merge 2 commits into
python-babel:masterfrom
evonbevern:master

Conversation

@evonbevern

Copy link
Copy Markdown

Before this request, f-strings were causing the program to crash with an exception. After the try catch block is added in extract.py, f-strings will raise a NameError.

@akx akx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test case, please?

akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
akx added a commit that referenced this pull request Oct 31, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
@akx akx closed this in #915 Nov 1, 2022
akx added a commit that referenced this pull request Nov 1, 2022
This is safer (as we don't actually execute anything),
and allows us to parse f-strings too.

Closes #769 (supersedes it)
Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants