diff --git a/BaseTools/Tests/TestTools.py b/BaseTools/Tests/TestTools.py index 1099fd4eea..545e1e3c13 100644 --- a/BaseTools/Tests/TestTools.py +++ b/BaseTools/Tests/TestTools.py @@ -109,6 +109,8 @@ class BaseToolsTest(unittest.TestCase): else: logFile = None if toolName is None: toolName = self.toolName + if sys.platform == "win32": + toolName += ".exe" bin = self.FindToolBin(toolName) if logFile is not None: logFile = open(os.path.join(self.testDir, logFile), 'w') @@ -135,7 +137,7 @@ class BaseToolsTest(unittest.TestCase): return open(os.path.join(self.testDir, fileName), mode) def ReadTmpFile(self, fileName): - f = open(self.GetTmpFilePath(fileName), 'r') + f = open(self.GetTmpFilePath(fileName), 'rb') data = f.read() f.close() return data