Tested (on windows) with python 3.6, but I guess it's the same in py3.7:
# test.py
def hello(x):
print(_(f'hello {x}'))
> py pygettext.py test.py
Traceback (most recent call last):
File "C:\Program Files\Python36\Tools\i18n\pygettext.py", line 623, in <module>
if __name__ == '__main__':
File "C:\Program Files\Python36\Tools\i18n\pygettext.py", line 597, in main
for _token in tokens:
File "C:\Program Files\Python36\Tools\i18n\pygettext.py", line 328, in __call__
## 'tstring:', tstring
File "C:\Program Files\Python36\Tools\i18n\pygettext.py", line 382, in __openseen
elif ttype == tokenize.STRING:
File "C:\Program Files\Python36\Tools\i18n\pygettext.py", line 236, in safe_eval
# unwrap quotes, safely
File "<string>", line 1, in <module>
NameError: name 'x' is not defined |