Skip to content

Commit 169e6ae

Browse files
mkdir when destination directory doesn't exist (#9060)
Fixes #8980 Make sure we mkdir if destination directory doesn't exist. I have no idea why it doesn't work before ghstack-source-id: 745e02d5e147f67927a86ccb25a4330e2aceeccd Pull Request resolved: #9055 Co-authored-by: Mengwei Liu <[email protected]>
1 parent f6c5959 commit 169e6ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ def build_extension(self, ext: _BaseExtension) -> None:
463463
dst_file: Path = ext.dst_path(self)
464464

465465
# Ensure that the destination directory exists.
466-
self.mkpath(os.fspath(dst_file.parent))
466+
if not dst_file.parent.exists():
467+
self.mkpath(os.fspath(dst_file.parent))
467468

468469
# Copy the file.
469470
self.copy_file(os.fspath(src_file), os.fspath(dst_file))

0 commit comments

Comments
 (0)