]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/MkPkg.py
BaseTools: Replace StandardError with Expression
[mirror_edk2.git] / BaseTools / Source / Python / UPT / MkPkg.py
index 2eb84588bdc495521e557f4cae6cfddead6ab669..e7ec328a78d9be0830c51fcd4bebd087c2dd7bfb 100644 (file)
@@ -50,6 +50,7 @@ from Library.ParserValidate import IsValidPath
 \r
 from Core.DistributionPackageClass import DistributionPackageClass\r
 from Core.PackageFile import PackageFile\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 \r
 ## CheckForExistingDp\r
 #\r
@@ -72,7 +73,7 @@ def CheckForExistingDp(Path):
 #\r
 #\r
 def Main(Options = None):\r
-    if Options == None:\r
+    if Options is None:\r
         Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FOUND)\r
     try:\r
         DataBase = GlobalData.gDB        \r
@@ -136,7 +137,7 @@ def Main(Options = None):
                 # write().\r
                 #\r
                 FromFile = os.path.normpath(FileObject.GetURI()).encode('utf_8')\r
-                FileFullPath = os.path.normpath(os.path.join(WorkspaceDir, FromFile))\r
+                FileFullPath = mws.join(WorkspaceDir, FromFile)\r
                 if FileFullPath in RePkgDict:\r
                     (DpGuid, DpVersion, DpName, Repackage) = RePkgDict[FileFullPath]\r
                     if not Repackage:\r
@@ -183,7 +184,7 @@ def Main(Options = None):
                     DistPkg.Header.RePackage = True\r
           \r
         Cwd = getcwd()\r
-        chdir(WorkspaceDir)        \r
+        chdir(WorkspaceDir)\r
         ContentFile.PackFiles(FileList)\r
         chdir(Cwd)\r
         \r
@@ -212,7 +213,7 @@ def Main(Options = None):
         Logger.Quiet(ST.MSG_FINISH)\r
         ReturnCode = 0\r
 \r
-    except FatalError, XExcept:\r
+    except FatalError as XExcept:\r
         ReturnCode = XExcept.args[0]        \r
         if Logger.GetLevel() <= Logger.DEBUG_9:\r
             Logger.Quiet(ST.MSG_PYTHON_ON % \\r
@@ -264,7 +265,7 @@ def CheckFileList(QualifiedExt, FileList, ErrorStringExt, ErrorStringFullPath):
                          ErrorStringExt % Item)\r
         \r
         Item = os.path.normpath(Item)\r
-        Path = os.path.normpath(os.path.join(WorkspaceDir, Item))\r
+        Path = mws.join(WorkspaceDir, Item)\r
         if not os.path.exists(Path):\r
             Logger.Error("\nMkPkg", FILE_NOT_FOUND, ST.ERR_NOT_FOUND % Item)\r
         elif Item == Path:\r