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

Unified Diff: recipe_modules/step/api.py

Issue 2933473002: [context] Split "env" values and prefixes. (Closed)
Patch Set: comments Created 3 years, 6 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
Index: recipe_modules/step/api.py
diff --git a/recipe_modules/step/api.py b/recipe_modules/step/api.py
index ce22841e74be7455ce78aa198edda3109f825f15..ec83518d5f963a27c81a12d79ef8ab54381e7eb0 100644
--- a/recipe_modules/step/api.py
+++ b/recipe_modules/step/api.py
@@ -171,12 +171,8 @@ class StepApi(recipe_api.RecipeApiPlain):
if cwd and cwd == self.m.path['start_dir']:
cwd = None
- env = self.m.context.env
- if self._prefix_path:
- ps = self.m.path.pathsep
- prefix = ps.join(self._prefix_path)
- suffix = env.get('PATH', '%(PATH)s')
- env['PATH'] = '%s%s%s' % (prefix, ps, suffix)
+ with self.m.context(env_prefixes={'PATH': self._prefix_path}):
+ env_prefixes = self.m.context.env_prefixes
if ok_ret in ('any', 'all'):
ok_ret = range(-256, 256)
@@ -186,7 +182,9 @@ class StepApi(recipe_api.RecipeApiPlain):
base_name=full_name or name,
cmd=cmd,
cwd=cwd,
- env=env,
+ env=self.m.context.env,
+ env_prefixes=env_prefixes,
iannucci 2017/06/13 20:28:12 tuple(env_prefixen, pathsep)
dnj 2017/06/13 21:46:26 Done.
+ pathsep=self.m.path.pathsep,
allow_subannotations=bool(allow_subannotations),
trigger_specs=[self._make_trigger_spec(trig)
for trig in (trigger_specs or ())],

Powered by Google App Engine
This is Rietveld 408576698