@@ -325,15 +325,20 @@ def extract_from_file(
325325 options , strip_comment_tags ))
326326
327327
328- def _match_messages_against_spec (lineno : int , messages : list [str | None ], comments : list [str ],
329- fileobj : _FileObj , spec : tuple [int | tuple [int , str ], ...]):
328+ def _match_messages_against_spec (
329+ lineno : int ,
330+ messages : list [str | None ],
331+ comments : list [str ],
332+ fileobj : _FileObj ,
333+ spec : tuple [int | tuple [int , str ], ...],
334+ ):
330335 translatable = []
331336 context = None
332337
333338 # last_index is 1 based like the keyword spec
334339 last_index = len (messages )
335340 for index in spec :
336- if isinstance (index , tuple ): # (n, 'c')
341+ if isinstance (index , tuple ): # (n, 'c')
337342 context = messages [index [0 ] - 1 ]
338343 continue
339344 if last_index < index :
@@ -622,9 +627,7 @@ def extract_python(
622627 elif tok == NAME and value in keywords :
623628 funcname = value
624629
625- if (current_fstring_start is not None
626- and tok not in {FSTRING_START , FSTRING_MIDDLE }
627- ):
630+ if current_fstring_start is not None and tok not in {FSTRING_START , FSTRING_MIDDLE }:
628631 # In Python 3.12, tokens other than FSTRING_* mean the
629632 # f-string is dynamic, so we don't wan't to extract it.
630633 # And if it's FSTRING_END, we've already handled it above.
0 commit comments