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

Unified Diff: recipe_modules/file/resources/fileutil.py

Issue 2973133002: [file] fix glob_paths when NO paths match, add tests. (Closed)
Patch Set: Created 3 years, 5 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_modules/file/examples/glob.expected/basic.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/file/resources/fileutil.py
diff --git a/recipe_modules/file/resources/fileutil.py b/recipe_modules/file/resources/fileutil.py
index 7bd04c247dd621bc67c39b40dbcfbb878863a4ce..c02db54a2026eccaf53c6ef5a7d0142d485476b5 100755
--- a/recipe_modules/file/resources/fileutil.py
+++ b/recipe_modules/file/resources/fileutil.py
@@ -154,7 +154,9 @@ def _Glob(base, pattern):
cwd = os.getcwd()
try:
os.chdir(base)
- print('\n'.join(sorted(glob.glob(pattern))))
+ hits = glob.glob(pattern)
+ if hits:
+ print('\n'.join(sorted(hits)))
finally:
os.chdir(cwd)
« no previous file with comments | « recipe_modules/file/examples/glob.expected/basic.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698