OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """A database of OWNERS files.""" | 5 """A database of OWNERS files.""" |
6 | 6 |
7 import collections | 7 import collections |
8 import re | 8 import re |
9 | 9 |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 # If no more directories have OWNERS, we're done. | 209 # If no more directories have OWNERS, we're done. |
210 if not max_owner: | 210 if not max_owner: |
211 break | 211 break |
212 | 212 |
213 final_owners.add(max_owner) | 213 final_owners.add(max_owner) |
214 | 214 |
215 # Remove all directories owned by the current owner from the remaining | 215 # Remove all directories owned by the current owner from the remaining |
216 # list. | 216 # list. |
217 for dirname in owned_dirs[max_owner]: | 217 for dirname in owned_dirs[max_owner]: |
218 dirs.remove(dirname) | 218 if dirname in dirs: |
| 219 dirs.remove(dirname) |
219 | 220 |
220 return final_owners | 221 return final_owners |
OLD | NEW |