| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import ast | 5 import ast |
| 6 import contextlib | 6 import contextlib |
| 7 import fnmatch | 7 import fnmatch |
| 8 import json | 8 import json |
| 9 import os | 9 import os |
| 10 import pipes | 10 import pipes |
| 11 import shlex | 11 import shlex |
| 12 import shutil | 12 import shutil |
| 13 import subprocess | 13 import subprocess |
| 14 import sys | 14 import sys |
| 15 import tempfile | 15 import tempfile |
| 16 import traceback | |
| 17 | 16 |
| 18 | 17 |
| 19 @contextlib.contextmanager | 18 @contextlib.contextmanager |
| 20 def TempDir(): | 19 def TempDir(): |
| 21 dirname = tempfile.mkdtemp() | 20 dirname = tempfile.mkdtemp() |
| 22 try: | 21 try: |
| 23 yield dirname | 22 yield dirname |
| 24 finally: | 23 finally: |
| 25 shutil.rmtree(dirname) | 24 shutil.rmtree(dirname) |
| 26 | 25 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 non_system_module_paths = map(ConvertPycToPy, non_system_module_paths) | 192 non_system_module_paths = map(ConvertPycToPy, non_system_module_paths) |
| 194 return list(set(non_system_module_paths)) | 193 return list(set(non_system_module_paths)) |
| 195 | 194 |
| 196 | 195 |
| 197 def WriteDepfile(path, dependencies): | 196 def WriteDepfile(path, dependencies): |
| 198 with open(path, 'w') as depfile: | 197 with open(path, 'w') as depfile: |
| 199 depfile.write(path) | 198 depfile.write(path) |
| 200 depfile.write(': ') | 199 depfile.write(': ') |
| 201 depfile.write(' '.join(dependencies)) | 200 depfile.write(' '.join(dependencies)) |
| 202 depfile.write('\n') | 201 depfile.write('\n') |
| OLD | NEW |