From 5b94a9a5da51b360d4c03008461d48467f9c1318 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 16 Nov 2019 14:12:46 +0100 Subject: [PATCH] Use ==/!= to compare str, bytes, and int literals Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. On n Python >= 3.8, these instances will raise SyntaxWarnings so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8 --- kubernetes/utils/create_from_yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/utils/create_from_yaml.py b/kubernetes/utils/create_from_yaml.py index 80efa085f9..896f68026e 100644 --- a/kubernetes/utils/create_from_yaml.py +++ b/kubernetes/utils/create_from_yaml.py @@ -102,7 +102,7 @@ def create_from_dict(k8s_client, data, verbose=False, namespace='default', for yml_object in data["items"]: # Mitigate cases when server returns a xxxList object # See kubernetes-client/python#586 - if kind is not "": + if kind != "": yml_object["apiVersion"] = data["apiVersion"] yml_object["kind"] = kind try: