@@ -58,12 +58,11 @@ def install(self):
58
58
dst = spec [1 ]
59
59
60
60
if os .path .isfile (src ):
61
- if not os .path .isdir (os .path .dirname (os .path .join (install_root , p , dst ))):
62
- os .makedirs (os .path .dirname (os .path .join (install_root , p , dst )), exist_ok = True )
63
- shutil .copyfile (
64
- src ,
65
- os .path .join (install_root , p , dst , os .path .basename (src ))
66
- )
61
+ dst_file = os .path .join (install_root , p , dst , os .path .basename (src ))
62
+ dst_dir = os .path .dirname (dst_file )
63
+ if not os .path .isdir (dst_dir ):
64
+ os .makedirs (dst_dir )
65
+ shutil .copyfile (src , dst_file )
67
66
68
67
if "{dllext}" in spec [0 ] and platform .system () == "Windows" :
69
68
# See if there is a link library to copy as well
@@ -83,9 +82,13 @@ def install(self):
83
82
# if os.path.isdir(os.path.join(install_root, p, dst)):
84
83
# print("rmtree: %s" % os.path.join(install_root, p, dst))
85
84
# shutil.rmtree(os.path.join(install_root, p, dst))
85
+ dst_dir = os .path .join (install_root , p , dst , os .path .basename (src )),
86
+ if not os .path .isdir (dst_dir ):
87
+ os .makedirs (dst_dir , exist_ok = True )
88
+
86
89
shutil .copytree (
87
90
src ,
88
- os . path . join ( install_root , p , dst , os . path . basename ( src )) ,
91
+ dst_dir ,
89
92
dirs_exist_ok = True )
90
93
else :
91
94
raise Exception ("Source path \" %s\" doesn't exist" % src )
0 commit comments