OLD | NEW |
1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 """Some utility methods for getting and manipulating paths.""" | 5 """Some utility methods for getting and manipulating paths.""" |
6 | 6 |
7 # TODO(pamg): Have the buildbot use these, too. | 7 # TODO(pamg): Have the buildbot use these, too. |
8 | 8 |
9 | 9 |
10 import errno | 10 import errno |
11 import os | 11 import os |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 def MaybeMakeDirectory(*path): | 76 def MaybeMakeDirectory(*path): |
77 """Creates an entire path, if it doesn't already exist.""" | 77 """Creates an entire path, if it doesn't already exist.""" |
78 file_path = os.path.join(*path) | 78 file_path = os.path.join(*path) |
79 try: | 79 try: |
80 os.makedirs(file_path) | 80 os.makedirs(file_path) |
81 except OSError, e: | 81 except OSError, e: |
82 # errno.EEXIST is "File exists". If we see another error, re-raise. | 82 # errno.EEXIST is "File exists". If we see another error, re-raise. |
83 if e.errno != errno.EEXIST: | 83 if e.errno != errno.EEXIST: |
84 raise | 84 raise |
85 | |
OLD | NEW |