From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web11.6430.1575020652269346927 for ; Fri, 29 Nov 2019 01:44:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AgIhNlsE; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575020651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ciYaeER2M6Uwjs1GEQsZVNRl0o9EvIJxhJzOrrVgvLg=; b=AgIhNlsE1EyA2loy0bILF1n1tSPcqReOhlriGiDOtReql2V3khwRaWdo8upie+Ilfb8wtX /oVdqjoivaXBjRJ9Qh7Wlppr8Xk1Aj8idauFhyy1wI9p/ZcRd08T9In9Q9S70qwq4vs1IC nvdrTsiGkIAFObRgWqO0fzLMgIcgMTY= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-qn_81D0lPc66n1AHvPk7ig-1; Fri, 29 Nov 2019 04:44:08 -0500 Received: by mail-wr1-f70.google.com with SMTP id e3so15263613wrs.17 for ; Fri, 29 Nov 2019 01:44:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ciYaeER2M6Uwjs1GEQsZVNRl0o9EvIJxhJzOrrVgvLg=; b=UG8ZgCTQuwG73C5ahb/FjfyzHTeq/OVQivtfDIVqLD2AGbpXvft1BJACCC5YtS3TT8 uL/i+z9WTgZym32zwcjjU/0/veMiPrWCG4nKABmWDovdrefLEf6e49eS3EU/dTQoqkFM mUV3aGLS2YqiweUhbMNYHcDRfBeC272QCELe3/U8V2Zybswb9SdXdM0sqt+JPbvWk4Ba JKmDL1kD8mHoMyZtseOyI6yl83Vo+zovO+tlnE4Ty2pJKfqROPovPQKjZvtCf2vEhYSi iW7M2oJVY7BRLi/gLr3xj/RBDks/wmvbJYdfU3g3tJu09W/wNGpvC/DZ46LizVKZYDAs jBpA== X-Gm-Message-State: APjAAAWX7YeFMlGP1Ww2JysJ4L1sQ+HmIEEIJFp7Ig9hYQnZ6GRdSAka pd9n4tHGpT6PpsUehjYW+xkgEmvv9FC+RZe9LHgB3zTvR842OYFYQWL6DVFv4OVq0JFr2040AVW oBxiQqGNSbu7mIw== X-Received: by 2002:adf:fa87:: with SMTP id h7mr42507913wrr.172.1575020647504; Fri, 29 Nov 2019 01:44:07 -0800 (PST) X-Google-Smtp-Source: APXvYqw416EcjPp1ALMJL+kwmnnc2jZgqQzWUy8fH0H3eGHu4VxjOBHxobNSyAwYbe9JS0n75T8eKg== X-Received: by 2002:adf:fa87:: with SMTP id h7mr42507893wrr.172.1575020647304; Fri, 29 Nov 2019 01:44:07 -0800 (PST) Return-Path: Received: from [10.101.1.81] ([176.12.107.132]) by smtp.gmail.com with ESMTPSA id h8sm9848574wrx.63.2019.11.29.01.44.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Nov 2019 01:44:06 -0800 (PST) Subject: Re: [edk2-devel] [PATCH] BaseTools:Change judgment symbol "is" to "==" for python3.8 To: "devel@edk2.groups.io" , "zhijux.fan@intel.com" Cc: "Gao, Liming" , "Feng, Bob C" References: From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <85c42c66-3cb5-1247-f5b6-33b709a5078e@redhat.com> Date: Fri, 29 Nov 2019 10:44:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: X-MC-Unique: qn_81D0lPc66n1AHvPk7ig-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 11/29/19 7:08 AM, Fan, ZhijuX via Groups.Io wrote: > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2304 > > build.py and BuildReport.py warning using python 3.8 > SyntaxWarning: "is" with a literal. Did you mean "=="? Maybe: BuildReport.py warning using python 3.8: SyntaxWarning: "is" with a literal. Did you mean "=="? > > For comparison of two strings use "==" instead of "is" > The patch is going to fixed this issue. Maybe: Fix this comparison of two strings warning by using "==" instead of "is". > > Cc: Liming Gao > Cc: Bob Feng > Signed-off-by: Zhiju.Fan > --- > BaseTools/Source/Python/build/BuildReport.py | 2 +- > BaseTools/Source/Python/build/build.py | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py > index 880459d367..8efa869162 100644 > --- a/BaseTools/Source/Python/build/BuildReport.py > +++ b/BaseTools/Source/Python/build/BuildReport.py > @@ -2042,7 +2042,7 @@ class FdReport(object): > self.VPDBaseAddress = 0 > self.VPDSize = 0 > for index, FdRegion in enumerate(Fd.RegionList): > - if str(FdRegion.RegionType) is 'FILE' and Wa.Platform.VpdToolGuid in str(FdRegion.RegionDataList): > + if str(FdRegion.RegionType) == 'FILE' and Wa.Platform.VpdToolGuid in str(FdRegion.RegionDataList): > self.VPDBaseAddress = self.FdRegionList[index].BaseAddress > self.VPDSize = self.FdRegionList[index].Size > break > diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py > index 07f1f21b5d..4b31356a42 100755 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -2064,7 +2064,7 @@ class Build(): > if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDict: > FdDict = Fdf.Profile.FdDict[Fdf.CurrentFdName] > for FdRegion in FdDict.RegionList: > - if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList): > + if str(FdRegion.RegionType) == 'FILE' and self.Platform.VpdToolGuid in str(FdRegion.RegionDataList): This already has been fixed in commit 49fb9f7e06b92. > if int(FdRegion.Offset) % 8 != 0: > EdkLogger.error("build", FORMAT_INVALID, 'The VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset)) > Wa.FdfProfile = Fdf.Profile > -- > 2.14.1.windows.1 > >