From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web09.7645.1575544800883259434 for ; Thu, 05 Dec 2019 03:20:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXkZJK8F; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575544800; 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=6aLkFR3qN9Hp6OHUsc/qtGwQKsF8tgmDuDaQu29zGKo=; b=gXkZJK8Fbiidvk5r/zrmWzD4POo7tUOMTxynEHmjVf7fhrdyp8tdbVkI9RrghFC/2HYqB2 ZhAUsFYkf38ZDxgn9/+Q+aFqOnpw6hGdjgGr/i7XUuT3ZYDMvAbV8loJqTS2RKnvmVyqB3 CRCCSsKmCl/TCdyQuB1hBMw/vdS69EQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-zbinORhMOiKd6nf0eptW6Q-1; Thu, 05 Dec 2019 06:19:56 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 296C9DBF8; Thu, 5 Dec 2019 11:19:55 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-76.brq.redhat.com [10.40.205.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA85E1D1; Thu, 5 Dec 2019 11:19:51 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: devel@edk2.groups.io Cc: Sean Brogan , "Zhiju . Fan" , Bret Barkelew , Bob Feng , Liming Gao , Michael D Kinney , Philippe Mathieu-Daude Subject: [PATCH v2 1/2] BaseTools: Avoid "is" with a literal Python 3.8 warnings Date: Thu, 5 Dec 2019 12:19:41 +0100 Message-Id: <20191205111942.19492-2-philmd@redhat.com> In-Reply-To: <20191205111942.19492-1-philmd@redhat.com> References: <20191205111942.19492-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: zbinORhMOiKd6nf0eptW6Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2304 The following statement produces a SyntaxWarning with Python 3.8: if str(FdRegion.RegionType) is 'FILE' and self.Platform.VpdToolGuid in \ str(FdRegion.RegionDataList): BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py:168: SyntaxWarning: \ "is" with a literal. Did you mean "=3D=3D"? Change the 'is' operator by the conventional '=3D=3D' comparator. Cc: Bob Feng Cc: Liming Gao Reviewed-by: Bob Feng Signed-off-by: Philippe Mathieu-Daude --- BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTool= s/Source/Python/AutoGen/WorkspaceAutoGen.py index fde48b4b2788..ec0c25bd1487 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -165,7 +165,7 @@ class WorkspaceAutoGen(AutoGen): if Fdf.CurrentFdName and Fdf.CurrentFdName in Fdf.Profile.FdDi= ct: FdDict =3D Fdf.Profile.FdDict[Fdf.CurrentFdName] for FdRegion in FdDict.RegionList: - if str(FdRegion.RegionType) is 'FILE' and self.Platfor= m.VpdToolGuid in str(FdRegion.RegionDataList): + if str(FdRegion.RegionType) =3D=3D 'FILE' and self.Pla= tform.VpdToolGuid in str(FdRegion.RegionDataList): if int(FdRegion.Offset) % 8 !=3D 0: EdkLogger.error("build", FORMAT_INVALID, 'The = VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset)) FdfProfile =3D Fdf.Profile --=20 2.21.0