Commit 15176ff0 authored by Vincent Pelletier's avatar Vincent Pelletier

all: Assorted cleanups.

parent b2ea5517
...@@ -308,8 +308,8 @@ def getSSLContext( ...@@ -308,8 +308,8 @@ def getSSLContext(
Extension( Extension(
x509.SubjectAlternativeName([ x509.SubjectAlternativeName([
x509.DNSName(hostname_dnsname) x509.DNSName(hostname_dnsname)
if hostname_ip_address is None if hostname_ip_address is None else
else x509.IPAddress(hostname_ip_address), x509.IPAddress(hostname_ip_address)
]), ]),
critical=True, critical=True,
), ),
......
...@@ -455,7 +455,7 @@ def toUnicode(value, encoding='ascii'): ...@@ -455,7 +455,7 @@ def toUnicode(value, encoding='ascii'):
def toBytes(value, encoding='ascii'): def toBytes(value, encoding='ascii'):
""" """
Convert valye to bytes object, if it is not already. Convert value to bytes object, if it is not already.
""" """
return value if isinstance(value, bytes) else value.encode(encoding) return value if isinstance(value, bytes) else value.encode(encoding)
......
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