From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92A38EE49A3 for ; Tue, 22 Aug 2023 11:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234846AbjHVLcU (ORCPT ); Tue, 22 Aug 2023 07:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234842AbjHVLcT (ORCPT ); Tue, 22 Aug 2023 07:32:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37D05E6D; Tue, 22 Aug 2023 04:32:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB91C65247; Tue, 22 Aug 2023 11:31:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13005C433CB; Tue, 22 Aug 2023 11:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692703895; bh=GiTxZ4OKRVhHnF8rRs0NLEZCAYYMH0DjrFcqPcvbtwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C+dz+OrRzrFog36SBIkFus9Mjj9aU89NcgEX9zt8qmw+l2toAiE2psRao/6yrPJue l/UMFbi2gfL5FCHL8iIX17AzGF6tdHjglOryAq8dlzVVd0M1E64DBjf7/xsj8RQpik pysBIAtF0TQgf7oocvbW5ZoPPbQyonRLfFWUW2fUB4QO+Y7fGaAUG2H2rFpJYdc3Bp sUJPTSYwKx2DPC9o0CaN/6kWXHNHxjDD8pOQ0GqfOhPIDMp4EeHT//jY9tM7emZk9M 9rxNK1BR+wTKCyw0DRi62s7ECvj7hhBy2O0Le0ZTiJ5GfwX9BinMxVC4WICBqPml/s BHuVonzRCwprg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ani Sinha , Wei Liu , Sasha Levin , kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, linux-hyperv@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 2/9] vmbus_testing: fix wrong python syntax for integer value comparison Date: Tue, 22 Aug 2023 07:31:23 -0400 Message-Id: <20230822113130.3550050-2-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230822113130.3550050-1-sashal@kernel.org> References: <20230822113130.3550050-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.46 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ani Sinha [ Upstream commit ed0cf84e9cc42e6310961c87709621f1825c2bb8 ] 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 Link: https://lore.kernel.org/r/20230705134408.6302-1-anisinha@redhat.com Signed-off-by: Wei Liu Signed-off-by: Sasha Levin --- tools/hv/vmbus_testing | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hv/vmbus_testing b/tools/hv/vmbus_testing index e7212903dd1d9..4467979d8f699 100755 --- a/tools/hv/vmbus_testing +++ b/tools/hv/vmbus_testing @@ -164,7 +164,7 @@ def recursive_file_lookup(path, file_map): def get_all_devices_test_status(file_map): for device in file_map: - if (get_test_state(locate_state(device, file_map)) is 1): + if (get_test_state(locate_state(device, file_map)) == 1): print("Testing = ON for: {}" .format(device.split("/")[5])) else: @@ -203,7 +203,7 @@ def write_test_files(path, value): def set_test_state(state_path, state_value, quiet): write_test_files(state_path, state_value) - if (get_test_state(state_path) is 1): + if (get_test_state(state_path) == 1): if (not quiet): print("Testing = ON for device: {}" .format(state_path.split("/")[5])) -- 2.40.1