@@ -296,9 +296,9 @@ def list_replace_or_append(lst: List[N], old: N, new: N) -> None:
296296 lst .append (new )
297297
298298 is_autofootnote_ref = NodeMatcher (nodes .footnote_reference , auto = Any )
299- old_foot_refs : List [nodes .footnote_reference ] = node .traverse (is_autofootnote_ref )
300- new_foot_refs : List [nodes .footnote_reference ] = patch .traverse (is_autofootnote_ref )
301- if len (list ( old_foot_refs )) != len (list ( new_foot_refs ) ):
299+ old_foot_refs : List [nodes .footnote_reference ] = list ( node .traverse (is_autofootnote_ref )) # NOQA
300+ new_foot_refs : List [nodes .footnote_reference ] = list ( patch .traverse (is_autofootnote_ref )) # NOQA
301+ if len (old_foot_refs ) != len (new_foot_refs ):
302302 old_foot_ref_rawsources = [ref .rawsource for ref in old_foot_refs ]
303303 new_foot_ref_rawsources = [ref .rawsource for ref in new_foot_refs ]
304304 logger .warning (__ ('inconsistent footnote references in translated message.' +
@@ -339,9 +339,9 @@ def list_replace_or_append(lst: List[N], old: N, new: N) -> None:
339339 # * use translated refname for section refname.
340340 # * inline reference "`Python <...>`_" has no 'refname'.
341341 is_refnamed_ref = NodeMatcher (nodes .reference , refname = Any )
342- old_refs : List [nodes .reference ] = node .traverse (is_refnamed_ref )
343- new_refs : List [nodes .reference ] = patch .traverse (is_refnamed_ref )
344- if len (list ( old_refs )) != len (list ( new_refs ) ):
342+ old_refs : List [nodes .reference ] = list ( node .traverse (is_refnamed_ref ) )
343+ new_refs : List [nodes .reference ] = list ( patch .traverse (is_refnamed_ref ) )
344+ if len (old_refs ) != len (new_refs ):
345345 old_ref_rawsources = [ref .rawsource for ref in old_refs ]
346346 new_ref_rawsources = [ref .rawsource for ref in new_refs ]
347347 logger .warning (__ ('inconsistent references in translated message.' +
@@ -366,10 +366,10 @@ def list_replace_or_append(lst: List[N], old: N, new: N) -> None:
366366
367367 # refnamed footnote should use original 'ids'.
368368 is_refnamed_footnote_ref = NodeMatcher (nodes .footnote_reference , refname = Any )
369- old_foot_refs = node .traverse (is_refnamed_footnote_ref )
370- new_foot_refs = patch .traverse (is_refnamed_footnote_ref )
369+ old_foot_refs = list ( node .traverse (is_refnamed_footnote_ref ) )
370+ new_foot_refs = list ( patch .traverse (is_refnamed_footnote_ref ) )
371371 refname_ids_map : Dict [str , List [str ]] = {}
372- if len (list ( old_foot_refs )) != len (list ( new_foot_refs ) ):
372+ if len (old_foot_refs ) != len (new_foot_refs ):
373373 old_foot_ref_rawsources = [ref .rawsource for ref in old_foot_refs ]
374374 new_foot_ref_rawsources = [ref .rawsource for ref in new_foot_refs ]
375375 logger .warning (__ ('inconsistent footnote references in translated message.' +
@@ -385,10 +385,10 @@ def list_replace_or_append(lst: List[N], old: N, new: N) -> None:
385385
386386 # citation should use original 'ids'.
387387 is_citation_ref = NodeMatcher (nodes .citation_reference , refname = Any )
388- old_cite_refs : List [nodes .citation_reference ] = node .traverse (is_citation_ref )
389- new_cite_refs : List [nodes .citation_reference ] = patch .traverse (is_citation_ref )
388+ old_cite_refs : List [nodes .citation_reference ] = list ( node .traverse (is_citation_ref )) # NOQA
389+ new_cite_refs : List [nodes .citation_reference ] = list ( patch .traverse (is_citation_ref )) # NOQA
390390 refname_ids_map = {}
391- if len (list ( old_cite_refs )) != len (list ( new_cite_refs ) ):
391+ if len (old_cite_refs ) != len (new_cite_refs ):
392392 old_cite_ref_rawsources = [ref .rawsource for ref in old_cite_refs ]
393393 new_cite_ref_rawsources = [ref .rawsource for ref in new_cite_refs ]
394394 logger .warning (__ ('inconsistent citation references in translated message.' +
@@ -405,10 +405,10 @@ def list_replace_or_append(lst: List[N], old: N, new: N) -> None:
405405 # Original pending_xref['reftarget'] contain not-translated
406406 # target name, new pending_xref must use original one.
407407 # This code restricts to change ref-targets in the translation.
408- old_xrefs = node .traverse (addnodes .pending_xref )
409- new_xrefs = patch .traverse (addnodes .pending_xref )
408+ old_xrefs = list ( node .traverse (addnodes .pending_xref ) )
409+ new_xrefs = list ( patch .traverse (addnodes .pending_xref ) )
410410 xref_reftarget_map = {}
411- if len (list ( old_xrefs )) != len (list ( new_xrefs ) ):
411+ if len (old_xrefs ) != len (new_xrefs ):
412412 old_xref_rawsources = [xref .rawsource for xref in old_xrefs ]
413413 new_xref_rawsources = [xref .rawsource for xref in new_xrefs ]
414414 logger .warning (__ ('inconsistent term references in translated message.' +
0 commit comments