Commit 31509c9d authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

JNI/Mojom generators: insert into sys.path instead of appending

This fixes a couple of build failures happening on a class of Python
installs.

I must say I can't quite pin down what characteristics in a Python
installation would influence this, but it certainly does on all
my machines that I setup to be non-corp machines to try and mimic
what open source developers may do.

Change-Id: Id60cd8b10141ca1486e0cdadfc7392b6d2bba3e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2445878
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813821}
parent 3c9a2964
...@@ -27,7 +27,9 @@ _FILE_DIR = os.path.dirname(__file__) ...@@ -27,7 +27,9 @@ _FILE_DIR = os.path.dirname(__file__)
_CHROMIUM_SRC = os.path.join(_FILE_DIR, os.pardir, os.pardir, os.pardir) _CHROMIUM_SRC = os.path.join(_FILE_DIR, os.pardir, os.pardir, os.pardir)
_BUILD_ANDROID_GYP = os.path.join(_CHROMIUM_SRC, 'build', 'android', 'gyp') _BUILD_ANDROID_GYP = os.path.join(_CHROMIUM_SRC, 'build', 'android', 'gyp')
sys.path.append(_BUILD_ANDROID_GYP) # Item 0 of sys.path is the directory of the main file; item 1 is PYTHONPATH
# (if set); item 2 is system libraries.
sys.path.insert(1, _BUILD_ANDROID_GYP)
from util import build_utils from util import build_utils
......
...@@ -20,9 +20,12 @@ import mojom.generate.generator as generator ...@@ -20,9 +20,12 @@ import mojom.generate.generator as generator
import mojom.generate.module as mojom import mojom.generate.module as mojom
from mojom.generate.template_expander import UseJinja from mojom.generate.template_expander import UseJinja
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, # Item 0 of sys.path is the directory of the main file; item 1 is PYTHONPATH
os.pardir, os.pardir, os.pardir, os.pardir, # (if set); item 2 is system libraries.
'build', 'android', 'gyp')) sys.path.insert(
1,
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir,
os.pardir, os.pardir, 'build', 'android', 'gyp'))
from util import build_utils from util import build_utils
......
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