ruff/crates/ruff_linter/resources/test/fixtures/pyupgrade/UP032_3.py
Charlie Marsh 090c1a4a19
Avoid converting f-strings within Django gettext calls (#7898)
## Summary

Django's `gettext` doesn't support f-strings, so we should avoid
translating `.format` calls in those cases.

Closes https://github.com/astral-sh/ruff/issues/7891.
2023-10-10 16:31:09 +00:00

9 lines
243 B
Python

from django.utils.translation import gettext
long = 'long'
split_to = 'split_to'
gettext(
'some super {} and complicated string so that the error code '
'E501 Triggers when this is not {} multi-line'.format(
long, split_to)
)