From 30e9761edeb44c64c50e14188168804449c0a3ca Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Thu, 24 Mar 2022 14:11:42 +0000 Subject: [PATCH] debian: Fix python3 syntax warning From https://docs.python.org/3/whatsnew/3.8.html#changes-in-python-behavior: The compiler now produces a SyntaxWarning when identity checks (is and is not) are used with certain types of literals (e.g. strings, numbers). These can often work by accident in CPython, but are not guaranteed by the language spec. The warning advises users to use equality tests (== and !=) instead. Test Plan: PASS Apply patch test the output of fm alarm-list on Debian 11. PASS Apply patch test the output of fm alarm-list on Centos 7. Closes-Bug: 1960958 Signed-off-by: Chuck Short Change-Id: I12c43f336a449876fab8592e34eace674518d0da --- python-fmclient/fmclient/fmclient/common/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-fmclient/fmclient/fmclient/common/http.py b/python-fmclient/fmclient/fmclient/common/http.py index 555987f5..c8b3b4d5 100644 --- a/python-fmclient/fmclient/fmclient/common/http.py +++ b/python-fmclient/fmclient/fmclient/common/http.py @@ -153,7 +153,7 @@ class HTTPClient(_BaseHTTPClient): if kwargs.get('insecure', False) is True: self.session.verify = False else: - if kwargs.get('cacert', None) is not '': # noqa: F632 + if kwargs.get('cacert', None) != '': self.session.verify = kwargs.get('cacert', True) self.session.cert = (kwargs.get('cert_file'),