]> 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 1bb5163e73e015ec5471653c03f3beae1f1f0a22..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
@@ -427,8 +427,6 @@ cleanlib:
         self.ResultFileList = []\r
         self.IntermediateDirectoryList = ["$(DEBUG_DIR)", "$(OUTPUT_DIR)"]\r
 \r
-        self.SourceFileDatabase = {}        # {file type : file path}\r
-        self.DestFileDatabase = {}          # {file type : file path}\r
         self.FileBuildTargetList = []       # [(src, target string)]\r
         self.BuildTargetList = []           # [target string]\r
         self.PendingBuildTargetList = []    # [FileBuildRule objects]\r
@@ -700,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
@@ -718,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
@@ -1032,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