]> git.ipfire.org Git - thirdparty/babel.git/commit
Use `ast` instead of `eval` for string extraction
authorAarni Koskela <akx@iki.fi>
Mon, 31 Oct 2022 11:05:00 +0000 (13:05 +0200)
committerAarni Koskela <akx@iki.fi>
Tue, 1 Nov 2022 08:48:43 +0000 (10:48 +0200)
commit2e5708f8f231696afcbea3f5803ca43b1e33bf7f
tree7e62cf0a4ec2ff2fc13661d1e5a7f105ffdfd25d
parenta946ae6bad2701a021969d82b550ba6be1f5c7d7
Use `ast` instead of `eval` for string extraction

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)
babel/messages/extract.py
tests/messages/test_extract.py