From 992c5abb533bb597aa910e64bca1ce0be320f906 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 Sep 2019 19:56:26 +0200 Subject: [PATCH] tests: don't compare string literal with "is" in "clients/tests/test-client.py" Recent Python versions warn about this: ./clients/tests/test-client.py:569: SyntaxWarning: "is" with a literal. Did you mean "=="? elif lang is de: ./clients/tests/test-client.py:572: SyntaxWarning: "is" with a literal. Did you mean "=="? elif lang is pl: And rightly so: https://bugs.python.org/issue34850 (cherry picked from commit 989b26a843acb259bc7ba8738b5994c8ca9a1e25) --- clients/tests/test-client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/tests/test-client.py b/clients/tests/test-client.py index ff5a3604dd..4ceff4b98d 100755 --- a/clients/tests/test-client.py +++ b/clients/tests/test-client.py @@ -566,10 +566,10 @@ class TestNmcli(NmTestBase): if lang is None or lang == 'C': lang = 'C' language = '' - elif lang is 'de': + elif lang == 'de': lang = 'de_DE.utf8' language = 'de' - elif lang is 'pl': + elif lang == 'pl': lang = 'pl_PL.UTF-8' language = 'pl' else: