]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/GenMake.py
BaseTools: Refactor python except statements
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / GenMake.py
index a373507422403e6b40ba882ecab90364ae39b9c6..48b66c570e0a86d6ae0612f799e97aca7792639e 100644 (file)
@@ -22,7 +22,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
 from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 from Common.BuildToolError import *\r
 from Common.Misc import *\r
-from Common.String import *\r
+from Common.StringUtils import *\r
 from BuildEngine import *\r
 import Common.GlobalData as GlobalData\r
 from collections import OrderedDict\r
@@ -698,7 +698,7 @@ cleanlib:
                     Src = self.ReplaceMacro(Src)\r
                     Dst = self.ReplaceMacro(Dst)\r
                     if Dst not in self.ResultFileList:\r
-                        self.ResultFileList.append('%s' % Dst)\r
+                        self.ResultFileList.append(Dst)\r
                     if '%s :' %(Dst) not in self.BuildTargetList:\r
                         self.BuildTargetList.append("%s :" %(Dst))\r
                         self.BuildTargetList.append('\t' + self._CP_TEMPLATE_[self._FileType] %{'Src': Src, 'Dst': Dst})\r
@@ -716,7 +716,7 @@ cleanlib:
             if DepsFileString == '':\r
                 continue\r
             OutputFile = self.ReplaceMacro(OutputFile)\r
-            self.ResultFileList.append('%s' % OutputFile)\r
+            self.ResultFileList.append(OutputFile)\r
             DepsFileString = self.ReplaceMacro(DepsFileString)\r
             self.BuildTargetList.append('%s : %s' % (OutputFile, DepsFileString))\r
             CmdString = ' '.join(FfsCmdList).strip()\r
@@ -1030,7 +1030,7 @@ cleanlib:
             else:\r
                 try:\r
                     Fd = open(F.Path, 'r')\r
-                except BaseException, X:\r
+                except BaseException as X:\r
                     EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=F.Path + "\n\t" + str(X))\r
 \r
                 FileContent = Fd.read()\r