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

Unified Diff: build/android/resource_sizes.py

Issue 2565303003: 🎄 Fix resource_sizes.py when no pak files exist. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/resource_sizes.py
diff --git a/build/android/resource_sizes.py b/build/android/resource_sizes.py
index 56e5a4969f6043df9f2f1f5b05e21c91dbc6471b..bf43c6cb0839f3b6abed94f8a6672d988cb2eb43 100755
--- a/build/android/resource_sizes.py
+++ b/build/android/resource_sizes.py
@@ -184,7 +184,8 @@ class _FileGroup(object):
return len(self._zip_infos)
def FindByPattern(self, pattern):
- return next(i for i in self._zip_infos if re.match(pattern, i.filename))
+ return next((i for i in self._zip_infos if re.match(pattern, i.filename)),
+ None)
def FindLargest(self):
return max(self._zip_infos, key=lambda i: i.file_size)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698