Skip to content

Commit

Permalink
style: Fix loop-variable-overrides-iterator (B020) (OSGeo#4010)
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored and a0x8o committed Jul 23, 2024
1 parent 828b1f9 commit 4fd0d2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions gui/wxpython/core/toolboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def _indent(elem, level=0):
elem.text = i + " "
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
_indent(elem, level + 1)
for _elem in elem:
_indent(_elem, level + 1)
if not elem.tail or not elem.tail.strip():
elem.tail = i
else:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ ignore = [
"B008", # function-call-in-default-argument
"B009", # get-attr-with-constant
"B015", # useless-comparison
"B020", # loop-variable-overrides-iterator
"B023", # function-uses-loop-variable
"B026", # star-arg-unpacking-after-keyword-arg
"B028", # no-explicit-stacklevel
Expand Down
10 changes: 5 additions & 5 deletions scripts/r.in.wms/wms_cap_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,17 @@ def _inhNotSame(self, element_name, cmp_type, layer, parent_layer, add_arg=None)
continue

is_there = False
for elem in elem:
for _elem in elem:
cmp_text = None
if cmp_type == "attribute":
if add_arg in elem.attrib:
cmp_text = elem.attrib[add_arg]
if add_arg in _elem.attrib:
cmp_text = _elem.attrib[add_arg]

elif cmp_type == "element_content":
cmp_text = elem.text
cmp_text = _elem.text

elif cmp_type == "child_element_content":
cmp = elem.find(self.xml_ns.Ns(add_arg))
cmp = _elem.find(self.xml_ns.Ns(add_arg))
if cmp is not None:
cmp_text = cmp.text

Expand Down

0 comments on commit 4fd0d2e

Please sign in to comment.