| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 3 import errno | 7 import errno |
| 4 import filecmp | 8 import filecmp |
| 5 import os.path | 9 import os.path |
| 6 import re | 10 import re |
| 7 import tempfile | 11 import tempfile |
| 8 import sys | 12 import sys |
| 9 | 13 |
| 10 def ExceptionAppend(e, msg): | 14 def ExceptionAppend(e, msg): |
| 11 """Append a message to the given exception's message.""" | 15 """Append a message to the given exception's message.""" |
| 12 if not e.args: | 16 if not e.args: |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 if idfun is None: | 334 if idfun is None: |
| 331 def idfun(x): return x | 335 def idfun(x): return x |
| 332 seen = {} | 336 seen = {} |
| 333 result = [] | 337 result = [] |
| 334 for item in seq: | 338 for item in seq: |
| 335 marker = idfun(item) | 339 marker = idfun(item) |
| 336 if marker in seen: continue | 340 if marker in seen: continue |
| 337 seen[marker] = 1 | 341 seen[marker] = 1 |
| 338 result.append(item) | 342 result.append(item) |
| 339 return result | 343 return result |
| OLD | NEW |