1414from rez .utils .logging_ import print_warning
1515from rez .utils .base26 import create_unique_base26_symlink
1616from rez .utils .colorize import Printer , warning
17- from rez .utils .filesystem import safe_makedirs , copy_or_replace , \
18- make_path_writable , get_existing_path , forceful_rmtree
17+ from rez .utils .filesystem import copy_or_replace , get_existing_path , \
18+ forceful_rmtree , make_path_writable
1919from rez .utils .sourcecode import IncludeModuleManager
2020from rez .utils .filesystem import TempDirs
2121from rez .package_test import PackageTestRunner , PackageTestResults
@@ -148,7 +148,7 @@ def _build_variant_base(self, variant, build_type, install_path=None,
148148 if clean and os .path .exists (variant_build_path ):
149149 self ._rmtree (variant_build_path )
150150
151- safe_makedirs (variant_build_path )
151+ os . makedirs (variant_build_path , exist_ok = True )
152152
153153 # find last dir of installation path that exists, and possibly make it
154154 # writable during variant installation
@@ -167,8 +167,7 @@ def _build_variant_base(self, variant, build_type, install_path=None,
167167 pkg_repo = package_repository_manager .get_repository (install_path )
168168 pkg_repo .pre_variant_install (variant .resource )
169169
170- if not os .path .exists (variant_install_path ):
171- safe_makedirs (variant_install_path )
170+ os .makedirs (variant_install_path , exist_ok = True )
172171
173172 # if hashed variants are enabled, create the variant shortlink
174173 if variant .parent .hashed_variants :
@@ -179,7 +178,7 @@ def _build_variant_base(self, variant, build_type, install_path=None,
179178 variant .parent .config .variant_shortlinks_dirname
180179 )
181180
182- safe_makedirs (base_shortlinks_path )
181+ os . makedirs (base_shortlinks_path , exist_ok = True )
183182
184183 # create the shortlink
185184 rel_variant_path = os .path .relpath (
@@ -293,7 +292,7 @@ def _install_include_modules(self, install_path):
293292 base_path = self .get_package_install_path (install_path )
294293
295294 path = os .path .join (base_path , IncludeModuleManager .include_modules_subpath )
296- safe_makedirs (path )
295+ os . makedirs (path , exist_ok = True )
297296
298297 definition_python_path = self .package .config .package_definition_python_path
299298
0 commit comments