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

Unified Diff: native_client_sdk/src/tools/oshelpers.py

Issue 12209097: [NaCl SDK] make example Makefiles quiet by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« PRESUBMIT.py ('K') | « native_client_sdk/src/tools/nacl_llvm.mk ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/oshelpers.py
diff --git a/native_client_sdk/src/tools/oshelpers.py b/native_client_sdk/src/tools/oshelpers.py
index 70a1368295fff770967815b7887c8e407d7e9d06..a2e2ce70ad4d3ab577e4b95647278bd35fc2bb59 100755
--- a/native_client_sdk/src/tools/oshelpers.py
+++ b/native_client_sdk/src/tools/oshelpers.py
@@ -133,7 +133,7 @@ def Copy(args):
src_list = []
for src in srcs:
files = glob.glob(src)
- if len(files) == 0:
+ if not files:
raise OSError('cp: no such file or directory: ' + src)
if files:
src_list.extend(files)
@@ -259,11 +259,10 @@ def Remove(args):
try:
for pattern in files:
dst_files = glob.glob(pattern)
- # Ignore non existing files when using force
- if len(dst_files) == 0 and options.force:
- print "rm: Skipping " + pattern
- continue
- elif len(dst_files) == 0:
+ if not dst_files:
+ # Ignore non existing files when using force
+ if options.force:
+ continue
raise OSError('rm: no such file or directory: ' + pattern)
for dst in dst_files:
@@ -363,7 +362,7 @@ def Zip(args):
src_files = []
for src_arg in src_args:
globbed_src_args = glob.glob(src_arg)
- if len(globbed_src_args) == 0:
+ if not globbed_src_args:
if not options.quiet:
print 'zip warning: name not matched: %s' % (src_arg,)
« PRESUBMIT.py ('K') | « native_client_sdk/src/tools/nacl_llvm.mk ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698