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

Unified Diff: recipe_modules/python/api.py

Issue 2933473002: [context] Split "env" values and prefixes. (Closed)
Patch Set: 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/python/api.py
diff --git a/recipe_modules/python/api.py b/recipe_modules/python/api.py
index 2f0d03f50623aeaecaab56eba11e555df9886b71..0268018c38a3751ffb44ad41012a82b332b75d7a 100644
--- a/recipe_modules/python/api.py
+++ b/recipe_modules/python/api.py
@@ -31,7 +31,7 @@ class PythonApi(recipe_api.RecipeApi):
standard Python interpreter.
kwargs: Additional keyword arguments to forward to "step".
"""
- env = self.m.context.env
+ env = {}
if venv:
cmd = ['vpython']
@@ -45,12 +45,8 @@ class PythonApi(recipe_api.RecipeApi):
else:
env['PYTHONUNBUFFERED'] = None
- context = {}
- if env:
- context['env'] = env
-
cmd.append(script)
- with self.m.context(**context):
+ with self.m.context(env=env):
return self.m.step(name, cmd + list(args or []), **kwargs)
def inline(self, name, program, add_python_log=True, **kwargs):

Powered by Google App Engine
This is Rietveld 408576698