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 31159EE49AA for ; Tue, 22 Aug 2023 11:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234983AbjHVLdz (ORCPT ); Tue, 22 Aug 2023 07:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234995AbjHVLdv (ORCPT ); Tue, 22 Aug 2023 07:33:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F9E8CEE; Tue, 22 Aug 2023 04:33:32 -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 191D265264; Tue, 22 Aug 2023 11:32:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 459CFC433C7; Tue, 22 Aug 2023 11:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692703931; bh=GiTxZ4OKRVhHnF8rRs0NLEZCAYYMH0DjrFcqPcvbtwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jx1v1cQkbNIGY1zZsVBFB0fzwj38k93G0SYDz/55d6qUJGd9oWv7+MfBvfzCNszsK 4WfD0da+af8sZEehtmmcRghHWU/zM76uaUyNhAzezu3jq2VoEmHh93WRYDpWl2BbMG wqe+XV0GYU/i3COSosUwqU4pROcREQW7IoxpPbyXcx93oiZAEehFkIVBIbQ9vO8e3J Q2bqJiD2M/AV2WvPT7YjLCf929inTvjRgf44epf6/2/Ab9wXb/EBGJTacBKeCaXLZJ n214R2QkZWKMQUaUn5hbqITfNWWTny3VqzCMiqIaDr28MqCyJjmX1OgW7mcZbzLg3A 4u/Fg5UizRt1w== 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 5.10 2/4] vmbus_testing: fix wrong python syntax for integer value comparison Date: Tue, 22 Aug 2023 07:32:04 -0400 Message-Id: <20230822113207.3550238-2-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230822113207.3550238-1-sashal@kernel.org> References: <20230822113207.3550238-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.191 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