Commit f1de72dd authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

Fix linux/win cross-compile

After https://chromium-review.googlesource.com/c/chromium/src/+/876683.

Bug: 644525
Change-Id: Ic8f71d5f4cababaa252fd4c9155ea8b34b29158b
Reviewed-on: https://chromium-review.googlesource.com/896695Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533749}
parent 806c48ae
......@@ -23,8 +23,10 @@ import sys
# if it finds versions with a different bitness first then win32file.pyd will
# fail to load with a cryptic error:
# ImportError: DLL load failed: %1 is not a valid Win32 application.
os.environ['path'] = os.path.dirname(sys.executable) + ';' + os.environ['path']
import win32file # pylint: disable=import-error
if sys.platform == 'win32':
os.environ['PATH'] = os.path.dirname(sys.executable) + \
os.pathsep + os.environ['PATH']
import win32file # pylint: disable=import-error
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
......@@ -181,7 +183,7 @@ class WinTool(object):
result = link.wait()
if not retry:
break
if result == 0:
if result == 0 and sys.platform == 'win32':
# Flush the file buffers to try to work around a Windows 10 kernel bug,
# https://crbug.com/644525
output_handle = win32file.CreateFile(pe_name, win32file.GENERIC_WRITE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment