Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1407)

Unified Diff: scripts/common/env.py

Issue 1402253002: CrOS: Load Chromite pins from JSON. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Rebase (without pin JSON). Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/common/cros_chromite.py ('k') | scripts/common/unittests/cros_chromite_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/common/env.py
diff --git a/scripts/common/env.py b/scripts/common/env.py
index 3e497ff48bf188938178b9eaa5334e59b3e48273..2f7aa9eb41f816920f35a8cd4a4aea7222d6fa12 100755
--- a/scripts/common/env.py
+++ b/scripts/common/env.py
@@ -46,6 +46,11 @@ __all__ = [
]
+# This is the path of the current "env" module. When "env" is run from
+# command-line, this path is automatically appended, and should be stripped out
+# of system path generation.
+_env_module_path = os.path.abspath(os.path.dirname(__file__))
+
# Name of enviornment extension file to seek.
ENV_EXTENSION_NAME = 'environment.cfg.py'
@@ -310,7 +315,9 @@ def GetSysPythonPath(hermetic=True):
Args:
hermetic (bool): If True, prune any non-system path.
"""
- path = PythonPath.FromPaths(*sys.path)
+ sys_paths = [p for p in sys.path
+ if p != _env_module_path]
+ path = PythonPath.FromPaths(*sys_paths)
if hermetic:
path = path.GetHermetic()
return path
« no previous file with comments | « scripts/common/cros_chromite.py ('k') | scripts/common/unittests/cros_chromite_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698