Skip to content

Commit

Permalink
fix(python): fix comparison to True/False
Browse files Browse the repository at this point in the history
from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.

Change-Id: I710d64c380eaf420f0ad29e65623ee677b094051
Signed-off-by: Galantsev, Dmitrii <[email protected]>
  • Loading branch information
e-kwsm authored and dmitrii-galantsev committed Sep 16, 2024
1 parent a3b0bc5 commit 866e2dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions amdsmi_cli/amdsmi_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3954,9 +3954,9 @@ def set_value(self, args, multiple_devices=False, gpu=None, fan=None, perf_level
break

# Only allow one device's arguments to be set at a time
if gpu_args_enabled == cpu_args_enabled == core_args_enabled == False:
if not any([gpu_args_enabled, cpu_args_enabled, core_args_enabled]):
raise ValueError('No GPU, CPU, or CORE arguments provided, specific arguments are needed')
elif gpu_args_enabled == cpu_args_enabled == core_args_enabled == True:
elif all([gpu_args_enabled, cpu_args_enabled, core_args_enabled]):
raise ValueError('Cannot set GPU, CPU, and CORE arguments at the same time')
elif not (gpu_args_enabled ^ cpu_args_enabled ^ core_args_enabled):
raise ValueError('Cannot set GPU, CPU, or CORE arguments at the same time')
Expand Down

0 comments on commit 866e2dd

Please sign in to comment.