Skip to content

Commit 5b94a9a

Browse files
authored
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
1 parent 02ef5be commit 5b94a9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kubernetes/utils/create_from_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def create_from_dict(k8s_client, data, verbose=False, namespace='default',
102102
for yml_object in data["items"]:
103103
# Mitigate cases when server returns a xxxList object
104104
# See kubernetes-client/python#586
105-
if kind is not "":
105+
if kind != "":
106106
yml_object["apiVersion"] = data["apiVersion"]
107107
yml_object["kind"] = kind
108108
try:

0 commit comments

Comments
 (0)