From 2e0067117d526390249a84778f50af67dac00963 Mon Sep 17 00:00:00 2001 From: Allan Lewis Date: Wed, 27 Apr 2016 11:17:04 +0100 Subject: [PATCH] wsdump, _abnf, _http: Compare to `None` using `in` --- bin/wsdump.py | 2 +- websocket/_abnf.py | 4 ++-- websocket/_http.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/wsdump.py b/bin/wsdump.py index c2fb49f..ea6bbb2 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -28,7 +28,7 @@ ENCODING = get_encoding() class VAction(argparse.Action): def __call__(self, parser, args, values, option_string=None): - if values==None: + if values is None: values = "1" try: values = int(values) diff --git a/websocket/_abnf.py b/websocket/_abnf.py index 2c7c4ab..912672a 100644 --- a/websocket/_abnf.py +++ b/websocket/_abnf.py @@ -116,7 +116,7 @@ class ABNF(object): self.rsv3 = rsv3 self.opcode = opcode self.mask = mask - if data == None: + if data is None: data = "" self.data = data self.get_mask_key = os.urandom @@ -224,7 +224,7 @@ class ABNF(object): data: data to mask/unmask. """ - if data == None: + if data is None: data = "" if isinstance(mask_key, six.text_type): diff --git a/websocket/_http.py b/websocket/_http.py index 63f3f83..8fae73f 100644 --- a/websocket/_http.py +++ b/websocket/_http.py @@ -161,7 +161,7 @@ def _ssl_socket(sock, user_sslopt, hostname): certPath = os.path.join( 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 check_hostname = sslopt["cert_reqs"] != ssl.CERT_NONE and sslopt.pop('check_hostname', True)