File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22restylers :
33 - pyment :
44 enabled : false
5+ - clazy :
6+ enabled : false
57 - " *"
Original file line number Diff line number Diff line change 1111from functools import cache as memoize
1212from typing import Any
1313from typing import Optional
14+ from xml .dom .minicompat import EmptyNodeList
1415
1516import requests
1617from lib import stage
@@ -374,9 +375,12 @@ def _translate_todo_list(
374375 if not translated :
375376 continue
376377 # Clear the translation node of any existing text.
377- translation .childNodes .clear ()
378+ if not isinstance (translation .childNodes , EmptyNodeList ):
379+ translation .childNodes .clear ()
378380 # Add the translation to the translation node.
379- translation .appendChild (dom .createTextNode (translated ))
381+ translation .appendChild ( # type: ignore[misc]
382+ dom .createTextNode (translated )
383+ )
380384 # Add a <translatorcomment> node to the message to indicate
381385 # that the translation was automated.
382386 if not message .getElementsByTagName ("translatorcomment" ):
You can’t perform that action at this time.
0 commit comments