]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/Check.py
BaseTools/Ecc/EOT: Add Python 3 support on ECC and EOT tools.
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / Check.py
index fc86ad96f2cf2fbdfc388abd74d77db43e29fb5b..d563a2f961b2487a3091a98fe46540f6ab339468 100644 (file)
@@ -223,7 +223,7 @@ class Check(object):
                     IndexOfLine = 0\r
                     for Line in op:\r
                         IndexOfLine += 1\r
-                        if not Line.endswith('\r\n'):\r
+                        if not bytes.decode(Line).endswith('\r\n'):\r
                             OtherMsg = "File %s has invalid line ending at line %s" % (Record[1], IndexOfLine)\r
                             EccGlobalData.gDb.TblReport.Insert(ERROR_GENERAL_CHECK_INVALID_LINE_ENDING, OtherMsg=OtherMsg, BelongsToTable='File', BelongsToItem=Record[0])\r
 \r
@@ -235,7 +235,7 @@ class Check(object):
             RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
             for Record in RecordSet:\r
                 if Record[2].upper() not in EccGlobalData.gConfig.BinaryExtList:\r
-                    op = open(Record[1], 'rb').readlines()\r
+                    op = open(Record[1], 'r').readlines()\r
                     IndexOfLine = 0\r
                     for Line in op:\r
                         IndexOfLine += 1\r