Skip to content

Commit ac11689

Browse files
committed
ignore mypy warnings
can be undone once python/typeshed#11841 is merged
1 parent e7951dc commit ac11689

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

debianbts/debianbts.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,24 +626,27 @@ def _encode_value(parent: ET.Element, name: str, value: Any) -> None:
626626
the value to be encoded
627627
628628
"""
629+
# note: the type: ignore annotations can be removed once
630+
# https://github.com/python/typeshed/pull/11841 is merged or the underlying
631+
# issue fixed
629632
if isinstance(value, str):
630633
el = ET.SubElement(parent, name)
631-
el.set(f"{{{XSI}}}type", ET.QName(XSD, "string"))
634+
el.set(f"{{{XSI}}}type", ET.QName(XSD, "string")) # type: ignore
632635
el.text = str(value)
633636
elif isinstance(value, int):
634637
# This includes booleans, as bool is a subtype of int
635638
el = ET.SubElement(parent, name)
636-
el.set(f"{{{XSI}}}type", ET.QName(XSD, "int"))
639+
el.set(f"{{{XSI}}}type", ET.QName(XSD, "int")) # type: ignore
637640
el.text = str(int(value))
638641
elif isinstance(value, Iterable):
639642
if isinstance(value, Mapping):
640643
# Flatten the dictionary
641644
value = [x for pair in value.items() for x in pair]
642645
el = ET.SubElement(parent, name)
643-
el.set(f"{{{XSI}}}type", ET.QName(SOAPENC, "Array"))
646+
el.set(f"{{{XSI}}}type", ET.QName(SOAPENC, "Array")) # type: ignore
644647
el.set(
645648
f"{{{SOAPENC}}}arrayType",
646-
ET.QName(XSD, "anyType[%d]" % len(value)),
649+
ET.QName(XSD, "anyType[%d]" % len(value)), # type: ignore
647650
)
648651
for x in value:
649652
_encode_value(el, "item", x)

0 commit comments

Comments
 (0)