summaryrefslogtreecommitdiff
path: root/babel/messages/extract.py
diff options
context:
space:
mode:
Diffstat (limited to 'babel/messages/extract.py')
-rw-r--r--babel/messages/extract.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/babel/messages/extract.py b/babel/messages/extract.py
index 0934937..453742e 100644
--- a/babel/messages/extract.py
+++ b/babel/messages/extract.py
@@ -90,7 +90,6 @@ DEFAULT_KEYWORDS: dict[str, _Keyword] = {
DEFAULT_MAPPING: list[tuple[str, str]] = [('**.py', 'python')]
-
def _strip_comment_tags(comments: MutableSequence[str], tags: Iterable[str]):
"""Helper function for `extract` that strips comment tags from strings
in a list of comment lines. This functions operates in-place.
@@ -660,8 +659,7 @@ def extract_javascript(
token = Token('operator', ')', token.lineno)
if options.get('parse_template_string') and not funcname and token.type == 'template_string':
- for item in parse_template_string(token.value, keywords, comment_tags, options, token.lineno):
- yield item
+ yield from parse_template_string(token.value, keywords, comment_tags, options, token.lineno)
elif token.type == 'operator' and token.value == '(':
if funcname:
@@ -794,8 +792,7 @@ def parse_template_string(
if level == 0 and expression_contents:
expression_contents = expression_contents[0:-1]
fake_file_obj = io.BytesIO(expression_contents.encode())
- for item in extract_javascript(fake_file_obj, keywords, comment_tags, options, lineno):
- yield item
+ yield from extract_javascript(fake_file_obj, keywords, comment_tags, options, lineno)
lineno += len(line_re.findall(expression_contents))
expression_contents = ''
prev_character = character