mypy: strict optional fixes.

This commit is contained in:
Christian Hudon
2017-05-24 12:28:26 -07:00
committed by Tim Abbott
parent 2f227a97d3
commit 1761a3b1c1
4 changed files with 7 additions and 4 deletions

View File

@@ -103,11 +103,11 @@ def der_encode_octet_string(val):
return der_encode_tlv(0x04, val)
def der_encode_sequence(tlvs, tagged=True):
# type: (List[bytes], Optional[bool]) -> bytes
# type: (List[Optional[bytes]], Optional[bool]) -> bytes
body = []
for i, tlv in enumerate(tlvs):
# Missing optional elements represented as None.
if not tlv:
if tlv is None:
continue
if tagged:
# Assume kerberos-style explicit tagging of components.