Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vmbus_testing: fix wrong python syntax for integer value comparison

It is incorrect in python to compare integer values using the "is" keyword.
The "is" keyword in python is used to compare references to two objects,
not their values. Newer version of python3 (version 3.8) throws a warning
when such incorrect comparison is made. For value comparison, "==" should
be used.

Fix this in the code and suppress the following warning:

/usr/sbin/vmbus_testing:167: SyntaxWarning: "is" with a literal. Did you mean "=="?

Signed-off-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/20230705134408.6302-1-anisinha@redhat.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Ani Sinha and committed by
Wei Liu
ed0cf84e 060f2b97

+2 -2
+2 -2
tools/hv/vmbus_testing
··· 164 164 def get_all_devices_test_status(file_map): 165 165 166 166 for device in file_map: 167 - if (get_test_state(locate_state(device, file_map)) is 1): 167 + if (get_test_state(locate_state(device, file_map)) == 1): 168 168 print("Testing = ON for: {}" 169 169 .format(device.split("/")[5])) 170 170 else: ··· 203 203 def set_test_state(state_path, state_value, quiet): 204 204 205 205 write_test_files(state_path, state_value) 206 - if (get_test_state(state_path) is 1): 206 + if (get_test_state(state_path) == 1): 207 207 if (not quiet): 208 208 print("Testing = ON for device: {}" 209 209 .format(state_path.split("/")[5]))