From nobody Mon Feb 9 01:42:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78144+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78144+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1627070558; cv=none; d=zohomail.com; s=zohoarc; b=jj8m06VygOmX63eUwfDpF91vBK9aijpvmbPeHC7Kk1oqceR/3o20FFqPPu1OIPHbMZllPG8+rRthFv3NShA2yX+LizKZBU0L1H+FxDE1nbaFogGf4AK9285ROgQM3T6XDfDH5iMc0/UcPZsryUN5Tlnkf5VFjWQZJixfh0byBGw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627070558; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=6+douw8f0iKDQ16R1CNuj0lxAr/W7rONx3Tz8BGpJp8=; b=hYQ+1ejVdLbgsw4CdZBMsKlV/tHqsy53kZJbI2HYrt+c3QaGMvhFXJzWgctY9cUX/epWtN6Q5MQ9VALkgZSVm0axixbYrxLxg/U6iM+2MKRvre9yqS/0oMvki4gsuQR4GQz7UPDUqSFv6uZzGYNGOHbVWwi75pZ1QeB/+m+sqqc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78144+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1627070558991879.7678782905987; Fri, 23 Jul 2021 13:02:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PKXBYY1788612xH1xCui7gAV; Fri, 23 Jul 2021 13:02:38 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web08.2022.1627070557609634135 for ; Fri, 23 Jul 2021 13:02:37 -0700 X-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-240-SY8UmVpbMN6A0g-pUOeN9g-1; Fri, 23 Jul 2021 16:02:34 -0400 X-MC-Unique: SY8UmVpbMN6A0g-pUOeN9g-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFCEF801A92 for ; Fri, 23 Jul 2021 20:02:33 +0000 (UTC) X-Received: from worklaptop.redhat.com (unknown [10.22.18.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BAA9100238C; Fri, 23 Jul 2021 20:02:33 +0000 (UTC) From: "Cole" To: devel@edk2.groups.io Cc: Cole Robinson Subject: [edk2-devel] [PATCH 1/3] build: Fix python3.10 threading DeprecationWarnings Date: Fri, 23 Jul 2021 16:02:26 -0400 Message-Id: <13a83729943f5e9d75228ddac3ae1d5e94afa948.1627070203.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,crobinso@redhat.com X-Gm-Message-State: qIJT1R7n3nZSwnDAcjMkiV5ax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1627070558; bh=buU650zXUjpZX6h46EdqWtjSg3jNEu3tWSRvqktaU30=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=T4HjN4w/bCbH4U+NnshpBztGcEe/rkKH0kyQ9LkEev0w8iksSITNBO1R6WNVKZHmU2r H9xHt2wSLudIh05AkYS30MVIGzqdjpDOTWaYu7FQATbo2tGXQ5+Q+DEPvpXfvHN+2tVnD 0XRR7tLOeEJyAHGEn87YtIFntVzdbYOAmT4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627071462490100004 Content-Type: text/plain; charset="utf-8" threading camelCase functions have preferred alternatives since python2.6. python3.10 has started emitting DeprecationWarnings for them Signed-off-by: Cole Robinson --- BaseTools/Source/Python/build/build.py | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 3e4d83409f..02b4898924 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -197,7 +197,7 @@ def ReadMessage(From, To, ExitFlag,MemTo=3DNone): To(LineStr) else: break - if ExitFlag.isSet(): + if ExitFlag.is_set(): break =20 class MakeSubProc(Popen): @@ -241,8 +241,8 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto =3D No= ne): EndOfProcedure.clear() if Proc.stdout: StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc.std= out, EdkLogger.info, EndOfProcedure,Proc.ProcOut)) - StdOutThread.setName("STDOUT-Redirector") - StdOutThread.setDaemon(False) + StdOutThread.name =3D "STDOUT-Redirector" + StdOutThread.daemon =3D False StdOutThread.start() =20 =20 @@ -433,8 +433,8 @@ class BuildTask: @staticmethod def StartScheduler(MaxThreadNumber, ExitFlag): SchedulerThread =3D Thread(target=3DBuildTask.Scheduler, args=3D(M= axThreadNumber, ExitFlag)) - SchedulerThread.setName("Build-Task-Scheduler") - SchedulerThread.setDaemon(False) + SchedulerThread.name =3D "Build-Task-Scheduler" + SchedulerThread.daemon =3D False SchedulerThread.start() # wait for the scheduler to be started, especially useful in Linux while not BuildTask.IsOnGoing(): @@ -456,7 +456,7 @@ class BuildTask: # indicated to do so, or there's error in running thread # while (len(BuildTask._PendingQueue) > 0 or len(BuildTask._Read= yQueue) > 0 \ - or not ExitFlag.isSet()) and not BuildTask._ErrorFlag.i= sSet(): + or not ExitFlag.is_set()) and not BuildTask._ErrorFlag.= is_set(): EdkLogger.debug(EdkLogger.DEBUG_8, "Pending Queue (%d), Re= ady Queue (%d)" % (len(BuildTask._PendingQueue), len(Build= Task._ReadyQueue))) =20 @@ -474,7 +474,7 @@ class BuildTask: BuildTask._PendingQueueLock.release() =20 # launch build thread until the maximum number of threads = is reached - while not BuildTask._ErrorFlag.isSet(): + while not BuildTask._ErrorFlag.is_set(): # empty ready queue, do nothing further if len(BuildTask._ReadyQueue) =3D=3D 0: break @@ -498,12 +498,12 @@ class BuildTask: time.sleep(0.01) =20 # wait for all running threads exit - if BuildTask._ErrorFlag.isSet(): + if BuildTask._ErrorFlag.is_set(): EdkLogger.quiet("\nWaiting for all build threads exit...") - # while not BuildTask._ErrorFlag.isSet() and \ + # while not BuildTask._ErrorFlag.is_set() and \ while len(BuildTask._RunningQueue) > 0: EdkLogger.verbose("Waiting for thread ending...(%d)" % len= (BuildTask._RunningQueue)) - EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".j= oin(Th.getName() for Th in threading.enumerate())) + EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".j= oin(Th.name for Th in threading.enumerate())) # avoid tense loop time.sleep(0.1) except BaseException as X: @@ -531,7 +531,7 @@ class BuildTask: # @staticmethod def IsOnGoing(): - return not BuildTask._SchedulerStopped.isSet() + return not BuildTask._SchedulerStopped.is_set() =20 ## Abort the build @staticmethod @@ -547,7 +547,7 @@ class BuildTask: # @staticmethod def HasError(): - return BuildTask._ErrorFlag.isSet() + return BuildTask._ErrorFlag.is_set() =20 ## Get error message in running thread # @@ -644,7 +644,7 @@ class BuildTask: # TRICK: hide the output of threads left running, so that the = user can # catch the error message easily # - if not BuildTask._ErrorFlag.isSet(): + if not BuildTask._ErrorFlag.is_set(): GlobalData.gBuildingModule =3D "%s [%s, %s, %s]" % (str(se= lf.BuildItem.BuildObject), self.Bui= ldItem.BuildObject.Arch, self.Bui= ldItem.BuildObject.ToolChain, @@ -653,7 +653,7 @@ class BuildTask: EdkLogger.SetLevel(EdkLogger.ERROR) BuildTask._ErrorFlag.set() BuildTask._ErrorMessage =3D "%s broken\n %s [%s]" % \ - (threading.currentThread().getName()= , Command, WorkingDir) + (threading.current_thread().name, Co= mmand, WorkingDir) =20 # indicate there's a thread is available for another build task BuildTask._RunningQueueLock.acquire() @@ -667,8 +667,8 @@ class BuildTask: EdkLogger.quiet("Building ... %s" % repr(self.BuildItem)) Command =3D self.BuildItem.BuildCommand + [self.BuildItem.Target] self.BuildTread =3D Thread(target=3Dself._CommandThread, args=3D(C= ommand, self.BuildItem.WorkingDir)) - self.BuildTread.setName("build thread") - self.BuildTread.setDaemon(False) + self.BuildTread.name =3D "build thread" + self.BuildTread.daemon =3D False self.BuildTread.start() =20 ## The class contains the information related to EFI image @@ -1177,14 +1177,14 @@ class Build(): EndOfProcedure.clear() if Process.stdout: StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stdout, EdkLogger.info, EndOfProcedure)) - StdOutThread.setName("STDOUT-Redirector") - StdOutThread.setDaemon(False) + StdOutThread.name =3D "STDOUT-Redirector" + StdOutThread.daemon =3D False StdOutThread.start() =20 if Process.stderr: StdErrThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stderr, EdkLogger.quiet, EndOfProcedure)) - StdErrThread.setName("STDERR-Redirector") - StdErrThread.setDaemon(False) + StdErrThread.name =3D "STDERR-Redirector" + StdErrThread.daemon =3D False StdErrThread.start() # waiting for program exit Process.wait() @@ -1217,14 +1217,14 @@ class Build(): EndOfProcedure.clear() if Process.stdout: StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stdout, EdkLogger.info, EndOfProcedure)) - StdOutThread.setName("STDOUT-Redirector") - StdOutThread.setDaemon(False) + StdOutThread.name =3D "STDOUT-Redirector" + StdOutThread.daemon =3D False StdOutThread.start() =20 if Process.stderr: StdErrThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stderr, EdkLogger.quiet, EndOfProcedure)) - StdErrThread.setName("STDERR-Redirector") - StdErrThread.setDaemon(False) + StdErrThread.name =3D "STDERR-Redirector" + StdErrThread.daemon =3D False StdErrThread.start() # waiting for program exit Process.wait() --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78144): https://edk2.groups.io/g/devel/message/78144 Mute This Topic: https://groups.io/mt/84409129/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-