wsdump, _abnf, _http: Compare to None using in
This commit is contained in:
@@ -28,7 +28,7 @@ ENCODING = get_encoding()
|
|||||||
|
|
||||||
class VAction(argparse.Action):
|
class VAction(argparse.Action):
|
||||||
def __call__(self, parser, args, values, option_string=None):
|
def __call__(self, parser, args, values, option_string=None):
|
||||||
if values==None:
|
if values is None:
|
||||||
values = "1"
|
values = "1"
|
||||||
try:
|
try:
|
||||||
values = int(values)
|
values = int(values)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class ABNF(object):
|
|||||||
self.rsv3 = rsv3
|
self.rsv3 = rsv3
|
||||||
self.opcode = opcode
|
self.opcode = opcode
|
||||||
self.mask = mask
|
self.mask = mask
|
||||||
if data == None:
|
if data is None:
|
||||||
data = ""
|
data = ""
|
||||||
self.data = data
|
self.data = data
|
||||||
self.get_mask_key = os.urandom
|
self.get_mask_key = os.urandom
|
||||||
@@ -224,7 +224,7 @@ class ABNF(object):
|
|||||||
|
|
||||||
data: data to mask/unmask.
|
data: data to mask/unmask.
|
||||||
"""
|
"""
|
||||||
if data == None:
|
if data is None:
|
||||||
data = ""
|
data = ""
|
||||||
|
|
||||||
if isinstance(mask_key, six.text_type):
|
if isinstance(mask_key, six.text_type):
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ def _ssl_socket(sock, user_sslopt, hostname):
|
|||||||
|
|
||||||
certPath = os.path.join(
|
certPath = os.path.join(
|
||||||
os.path.dirname(__file__), "cacert.pem")
|
os.path.dirname(__file__), "cacert.pem")
|
||||||
if os.path.isfile(certPath) and user_sslopt.get('ca_certs', None) == None:
|
if os.path.isfile(certPath) and user_sslopt.get('ca_certs', None) is None:
|
||||||
sslopt['ca_certs'] = certPath
|
sslopt['ca_certs'] = certPath
|
||||||
check_hostname = sslopt["cert_reqs"] != ssl.CERT_NONE and sslopt.pop('check_hostname', True)
|
check_hostname = sslopt["cert_reqs"] != ssl.CERT_NONE and sslopt.pop('check_hostname', True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user