]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-126807: pygettext: Do not attempt to extract messages from function definit...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 14 Nov 2024 22:43:33 +0000 (23:43 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 22:43:33 +0000 (22:43 +0000)
commitbf40fdbff109eae6315a94b13aa74355a4f76a68
tree6ef3fbc3001e7adc5c2fb82b24303ef4a359de43
parentbf6fa21a9167df1df73d694dea1754be8d214f28
[3.13] gh-126807: pygettext: Do not attempt to extract messages from function definitions. (GH-126808) (GH-126846)

Fixes a bug where pygettext would attempt
to extract a message from a code like this:

def _(x): pass

This is because pygettext only looks at one
token at a time and '_(x)' looks like a
function call.

However, since 'x' is not a string literal,
it would erroneously issue a warning.
(cherry picked from commit 9a456383bed52010b90bd491277ea855626a7bba)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Lib/test/test_tools/test_i18n.py
Misc/NEWS.d/next/Tools-Demos/2024-11-13-22-23-36.gh-issue-126807.vpaWuN.rst [new file with mode: 0644]
Tools/i18n/pygettext.py