From 236a7beb3436196d5439f586fa7e9f3a171be955 Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 31 Mar 2020 16:20:22 +0100 Subject: Fix SyntaxWarning with Python 3.8 Under Python 3.8, the following SyntaxWarning is logged on every glanceclient invocation: SyntaxWarning: "is not" with a literal. Did you mean "!="? if kwargs.get('cacert', None) is not '': Make use of '!=' rather than 'is not' to avoid this warning. Change-Id: I11ed568932ec5ea0ffee629d6fd434433f262b67 --- glanceclient/common/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index 78c4bc5..6973f60 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -177,7 +177,7 @@ class HTTPClient(_BaseHTTPClient): if kwargs.get('insecure', False) is True: self.session.verify = False else: - if kwargs.get('cacert', None) is not '': + if kwargs.get('cacert', None) != '': self.session.verify = kwargs.get('cacert', True) self.session.cert = (kwargs.get('cert_file'), -- cgit v1.2.1