|
65 | 65 | from easybuild.tools.config import DEFAULT_WAIT_ON_LOCK_INTERVAL, ERROR, GENERIC_EASYBLOCK_PKG, IGNORE, WARN |
66 | 66 | from easybuild.tools.config import build_option, install_path |
67 | 67 | from easybuild.tools.output import PROGRESS_BAR_DOWNLOAD_ONE, start_progress_bar, stop_progress_bar, update_progress_bar |
68 | | -from easybuild.tools.py2vs3 import HTMLParser, load_source, std_urllib, string_type |
| 68 | +from easybuild.tools.py2vs3 import HTMLParser, load_source, makedirs, std_urllib, string_type |
69 | 69 | from easybuild.tools.utilities import natural_keys, nub, remove_unwanted_chars, trace_msg |
70 | 70 |
|
71 | 71 | try: |
@@ -1918,15 +1918,9 @@ def mkdir(path, parents=False, set_gid=None, sticky=None): |
1918 | 1918 | # climb up until we hit an existing path or the empty string (for relative paths) |
1919 | 1919 | while existing_parent_path and not os.path.exists(existing_parent_path): |
1920 | 1920 | existing_parent_path = os.path.dirname(existing_parent_path) |
1921 | | - os.makedirs(path) |
| 1921 | + makedirs(path, exist_ok=True) |
1922 | 1922 | else: |
1923 | 1923 | os.mkdir(path) |
1924 | | - except FileExistsError as err: |
1925 | | - if os.path.exists(path): |
1926 | | - # This may happen if a parallel build creates the directory after we checked for its existence |
1927 | | - _log.debug("Directory creation aborted as it seems it was already created: %s", err) |
1928 | | - else: |
1929 | | - raise EasyBuildError("Failed to create directory %s: %s", path, err) |
1930 | 1924 | except OSError as err: |
1931 | 1925 | raise EasyBuildError("Failed to create directory %s: %s", path, err) |
1932 | 1926 |
|
|
0 commit comments