From 20cfbe399c5145a152673e026e5afe014bcd803b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moise=CC=81s=20Guimara=CC=83es?= Date: Sun, 13 Nov 2016 10:01:45 -0300 Subject: [PATCH] fixes integer comparison and adds virtual env to ignored files. --- wrapper/python/wolfssl/.gitignore | 3 +++ wrapper/python/wolfssl/wolfssl/_methods.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wrapper/python/wolfssl/.gitignore b/wrapper/python/wolfssl/.gitignore index 421703396..5e6f6f9bd 100644 --- a/wrapper/python/wolfssl/.gitignore +++ b/wrapper/python/wolfssl/.gitignore @@ -13,3 +13,6 @@ dist/ .tox/ # Sphinx documentation docs/_build/ + +# Virtual env +.env diff --git a/wrapper/python/wolfssl/wolfssl/_methods.py b/wrapper/python/wolfssl/wolfssl/_methods.py index c5d7901e6..ae0a03d9f 100644 --- a/wrapper/python/wolfssl/wolfssl/_methods.py +++ b/wrapper/python/wolfssl/wolfssl/_methods.py @@ -45,16 +45,16 @@ class WolfSSLMethod: if protocol not in _PROTOCOL_LIST: raise ValueError("this protocol is not supported") - elif protocol is PROTOCOL_SSLv3: + elif protocol == PROTOCOL_SSLv3: raise ValueError("this protocol is not supported") - elif protocol is PROTOCOL_TLSv1: + elif protocol == PROTOCOL_TLSv1: raise ValueError("this protocol is not supported") - elif protocol is PROTOCOL_TLSv1_1: + elif protocol == PROTOCOL_TLSv1_1: raise ValueError("this protocol is not supported") - elif protocol is PROTOCOL_TLSv1_2: + elif protocol == PROTOCOL_TLSv1_2: self.native_object = \ _lib.wolfTLSv1_2_server_method() if server_side else \ _lib.wolfTLSv1_2_client_method()