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
This commit is contained in:
Christian Clauss 2019-11-16 14:12:46 +01:00 committed by GitHub
parent 02ef5be4ec
commit 5b94a9a5da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: