Commit 6e0a9514 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

bind-gen: Attempt to fix a build failure on a certain Win env, part 2

Preserves sys.path[0] as is just in case.

Bug: 839389, 1046970
Change-Id: I6904ff831783693720e6ee5e9597e7f40f7df683
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041111Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738893}
parent 8d0a93dc
...@@ -15,7 +15,7 @@ def _setup_sys_path(): ...@@ -15,7 +15,7 @@ def _setup_sys_path():
root_dir = os.path.abspath( root_dir = os.path.abspath(
os.path.join(this_dir, *(['..'] * expected_path.count('/')))) os.path.join(this_dir, *(['..'] * expected_path.count('/'))))
sys.path = [ module_dirs = (
# //third_party/blink/renderer/bindings/scripts/web_idl # //third_party/blink/renderer/bindings/scripts/web_idl
os.path.join(root_dir, 'third_party', 'blink', 'renderer', 'bindings', os.path.join(root_dir, 'third_party', 'blink', 'renderer', 'bindings',
'scripts'), 'scripts'),
...@@ -24,7 +24,11 @@ def _setup_sys_path(): ...@@ -24,7 +24,11 @@ def _setup_sys_path():
'scripts'), 'scripts'),
# //third_party/mako/mako # //third_party/mako/mako
os.path.join(root_dir, 'third_party', 'mako'), os.path.join(root_dir, 'third_party', 'mako'),
] + sys.path )
for module_dir in reversed(module_dirs):
# Preserve sys.path[0] as is.
# https://docs.python.org/3/library/sys.html?highlight=path[0]#sys.path
sys.path.insert(1, module_dir)
_setup_sys_path() _setup_sys_path()
......
...@@ -15,7 +15,7 @@ def _setup_sys_path(): ...@@ -15,7 +15,7 @@ def _setup_sys_path():
root_dir = os.path.abspath( root_dir = os.path.abspath(
os.path.join(this_dir, *(['..'] * expected_path.count('/')))) os.path.join(this_dir, *(['..'] * expected_path.count('/'))))
sys.path = [ module_dirs = (
# //third_party/blink/renderer/build/scripts/blinkbuild # //third_party/blink/renderer/build/scripts/blinkbuild
os.path.join(root_dir, 'third_party', 'blink', 'renderer', 'build', os.path.join(root_dir, 'third_party', 'blink', 'renderer', 'build',
'scripts'), 'scripts'),
...@@ -25,7 +25,11 @@ def _setup_sys_path(): ...@@ -25,7 +25,11 @@ def _setup_sys_path():
os.path.join(root_dir, 'third_party', 'pyjson5', 'src'), os.path.join(root_dir, 'third_party', 'pyjson5', 'src'),
# //tools/idl_parser # //tools/idl_parser
os.path.join(root_dir, 'tools'), os.path.join(root_dir, 'tools'),
] + sys.path )
for module_dir in reversed(module_dirs):
# Preserve sys.path[0] as is.
# https://docs.python.org/3/library/sys.html?highlight=path[0]#sys.path
sys.path.insert(1, module_dir)
_setup_sys_path() _setup_sys_path()
......
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