Skip to content

Commit

Permalink
Fix SyntaxWarning for 'is not' with literals
Browse files Browse the repository at this point in the history
On Python 3.8 there was a change: "The compiler now produces a SyntaxWarning when identity checks (is and is not) are used with certain types of literals (e.g. strings, numbers)."
More info here: https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/
Replaced the 'is not' with '!='
  • Loading branch information
g3rzi authored May 6, 2020
1 parent 81834c6 commit c20370a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions KubiScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def print_pods_with_access_secret_via_volumes(namespace=None):
#mount_info += 'Mounted path: {0}\nSecret name: {1}\nVolume name: {2}\n'.format(volume_mount.mount_path, volume.secret.secret_name, volume.name)
mount_info += '{2}. Mounted path: {0}\n Secret name: {1}\n'.format(volume_mount.mount_path, volume.secret.secret_name, secrets_num)
secrets_num += 1
if mount_info is not '':
if mount_info != '':
t.add_row([pod.metadata.name, pod.metadata.namespace, container.name, mount_info])

print_table_aligned_left(t)
Expand All @@ -301,7 +301,7 @@ def print_pods_with_access_secret_via_environment(namespace=None):
if env.value_from is not None and env.value_from.secret_key_ref is not None:
mount_info += '{2}. Environemnt variable name: {0}\n Secret name: {1}\n'.format(env.name, env.value_from.secret_key_ref.name, secrets_num)
secrets_num += 1
if mount_info is not '':
if mount_info != '':
t.add_row([pod.metadata.name, pod.metadata.namespace, container.name, mount_info])

print_table_aligned_left(t)
Expand Down

0 comments on commit c20370a

Please sign in to comment.