Index: presubmit_support.py |
diff --git a/presubmit_support.py b/presubmit_support.py |
index 2922b4e32938c873da53decfc4e646e9b8d73174..55b858f3582decb1b0180a7ed542c09ff7ec8fd4 100755 |
--- a/presubmit_support.py |
+++ b/presubmit_support.py |
@@ -1093,7 +1093,11 @@ def ListRelevantPresubmitFiles(files, root): |
# Look for PRESUBMIT.py in all candidate directories. |
results = [] |
for directory in sorted(list(candidates)): |
- for f in os.listdir(directory): |
+ try: |
+ directory_files = os.listdir(directory) |
+ except OSError: |
+ directory_files = [] |
tandrii(chromium)
2016/08/17 09:39:13
continue
it's shorter and faster.
Tobias Sargeant
2016/08/17 09:57:45
Thanks. It seems like it's best to just wrap the w
|
+ for f in directory_files: |
p = os.path.join(directory, f) |
if os.path.isfile(p) and re.match( |
r'PRESUBMIT.*\.py$', f) and not f.startswith('PRESUBMIT_test'): |