]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/DataSection.py
BaseTools: Use absolute import in GenFds
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / DataSection.py
index 99d7392aaab3de984d803b62a8c656aa1544f418..a6387b07c582b15fb06496276dca863b1b8d44ea 100644 (file)
 ##\r
 # Import Modules\r
 #\r
-import Section\r
-from GenFdsGlobalVariable import GenFdsGlobalVariable\r
+from __future__ import absolute_import\r
+from . import Section\r
+from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import subprocess\r
-from Ffs import Ffs\r
+from .Ffs import Ffs\r
 import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import DataSectionClassObject\r
 from Common.Misc import PeImageClass\r
@@ -82,7 +83,7 @@ class DataSection (DataSectionClassObject):
                         CopyLongFilePath(MapFile, CopyMapFile)\r
 \r
         #Get PE Section alignment when align is set to AUTO\r
-        if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'):\r
+        if self.Alignment == 'Auto' and self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):\r
             ImageObj = PeImageClass (Filename)\r
             if ImageObj.SectionAlignment < 0x400:\r
                 self.Alignment = str (ImageObj.SectionAlignment)\r
@@ -92,7 +93,7 @@ class DataSection (DataSectionClassObject):
                 self.Alignment = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r
 \r
         NoStrip = True\r
-        if self.SecType in ('TE', 'PE32'):\r
+        if self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):\r
             if self.KeepReloc is not None:\r
                 NoStrip = self.KeepReloc\r
 \r
@@ -110,7 +111,7 @@ class DataSection (DataSectionClassObject):
                 )\r
             self.SectFileName = StrippedFile\r
 \r
-        if self.SecType == 'TE':\r
+        if self.SecType == BINARY_FILE_TYPE_TE:\r
             TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')\r
             GenFdsGlobalVariable.GenerateFirmwareImage(\r
                     TeFile,\r