From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 73DCE211D6184 for ; Wed, 20 Jun 2018 23:28:12 -0700 (PDT) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 21 Jun 2018 08:28:10 +0200 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Thu, 21 Jun 2018 07:27:49 +0100 Date: Thu, 21 Jun 2018 14:27:45 +0800 From: Gary Lin To: edk2-devel@lists.01.org Cc: Liming Gao Message-ID: <20180621062745.bldlgsc6mige5e4s@GaryWorkstation> References: <20180621044346.28495-1-glin@suse.com> <20180621044346.28495-3-glin@suse.com> MIME-Version: 1.0 In-Reply-To: <20180621044346.28495-3-glin@suse.com> User-Agent: NeoMutt/20170912 (1.9.0) Subject: Re: [PATCH v3 02/20] BaseTools: Refactor python except statements X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2018 06:28:14 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 21, 2018 at 12:43:28PM +0800, Gary Lin wrote: > Convert "except ... ," to "except ... as" to be compatible with python3. > Based on "futurize -f lib2to3.fixes.fix_except" > > Contributed-under: TianoCore Contribution Agreement 1.1 > Cc: Yonghong Zhu > Cc: Liming Gao > Signed-off-by: Gary Lin > --- > -->8-- > - except IOError as (errno, strerror): > + except IOError as xxx_todo_changeme: > + (errno, strerror) = xxx_todo_changeme.args > file_list.close() > if not Opt.silent: > sys.stderr.write("I/O ERROR : %s : %s\n" % (str(errno), strerror)) > @@ -100,7 +101,8 @@ def ShellCommandResults(CmdLine, Opt): > sys.stderr.flush() > returnValue = errno > > - except OSError as (errno, strerror): > + except OSError as xxx_todo_changeme1: > + (errno, strerror) = xxx_todo_changeme1.args > file_list.close() > if not Opt.silent: > sys.stderr.write("OS ERROR : %s : %s\n" % (str(errno), strerror)) > @@ -210,13 +212,15 @@ def RevertCmd(Filename, Opt): > sys.stderr.write("Subprocess ERROR : %s\n" % err_val) > sys.stderr.flush() > > - except IOError as (errno, strerror): > + except IOError as xxx_todo_changeme2: > + (errno, strerror) = xxx_todo_changeme2.args > if not Opt.silent: > sys.stderr.write("I/O ERROR : %d : %s\n" % (str(errno), strerror)) > sys.stderr.write("ERROR : this command failed : %s\n" % CmdLine) > sys.stderr.flush() > > - except OSError as (errno, strerror): > + except OSError as xxx_todo_changeme3: > + (errno, strerror) = xxx_todo_changeme3.args > if not Opt.silent: > sys.stderr.write("OS ERROR : %d : %s\n" % (str(errno), strerror)) > sys.stderr.write("ERROR : this command failed : %s\n" % CmdLine) I forgot to fix the naming of the tuple arguments. Will post a new patch if necessary. Gary Lin