mypy: fix Optional

parent 2398e701
Pipeline #43990 passed with stage
in 1 minute and 19 seconds
......@@ -199,7 +199,7 @@ class DNSReply:
def parse_wire(
self
) -> Tuple[Optional[dns.message.Message], Optional[str]]:
) -> Tuple[Optional[dns.message.Message], str]:
try:
return dns.message.from_wire(self.wire), self.WIREFORMAT_VALID
except dns.exception.FormError as exc:
......
......@@ -196,6 +196,10 @@ def match(
if expected.timeout or got.timeout or exp_malformed or got_malformed:
return # don't attempt to match any other fields
# checked above via exp/got_malformed, this is for mypy
assert exp_msg is not None
assert got_msg is not None
for criteria in match_fields:
try:
match_part(exp_msg, got_msg, criteria)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment