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

Unified Diff: recipe_modules/path/api.py

Issue 1925653002: recipe engine: require all path bases to be classes (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: rebase Created 4 years, 8 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 | « recipe_engine/config_types.py ('k') | recipe_modules/path/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/path/api.py
diff --git a/recipe_modules/path/api.py b/recipe_modules/path/api.py
index c32c64658b4a348555c95dc19a019e203261fd84..0d8abf483314b7b879542239262a249d875b3a76 100644
--- a/recipe_modules/path/api.py
+++ b/recipe_modules/path/api.py
@@ -191,12 +191,7 @@ class PathApi(recipe_api.RecipeApi):
self.c.dynamic_paths[pathname] = path
def __getitem__(self, name):
- if name in self.c.dynamic_paths:
- r = self.c.dynamic_paths[name]
- assert r is not None, ('Tried to get dynamic path %s but it has not been '
- 'set yet.' % name)
- return r
- if name in self.c.base_paths:
+ if name in self.c.base_paths or name in self.c.dynamic_paths:
return config_types.Path(config_types.NamedBasePath(name))
raise KeyError('Unknown path: %s' % name) # pragma: no cover
« no previous file with comments | « recipe_engine/config_types.py ('k') | recipe_modules/path/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698