@@ -1028,14 +1028,17 @@ def get_cache(self, url):
1028
1028
def set_cache (self , url ):
1029
1029
up = urlparse (formaturl (url , 'https' ))
1030
1030
if self .cache and up and up .netloc and os .path .isdir (self .path ):
1031
- cpath = os .path .join (self .cache , up .netloc , re .sub (r'^/' , '' , up .path ))
1032
- if not os .path .isdir (cpath ):
1033
- os .makedirs (cpath )
1034
-
1035
- scm_dir = '.' + self .scm .name
1036
- if os .path .isdir (os .path .join (cpath , scm_dir )):
1037
- rmtree_readonly (os .path .join (cpath , scm_dir ))
1038
- shutil .copytree (os .path .join (self .path , scm_dir ), os .path .join (cpath , scm_dir ))
1031
+ try :
1032
+ cpath = os .path .join (self .cache , up .netloc , re .sub (r'^/' , '' , up .path ))
1033
+ if not os .path .isdir (cpath ):
1034
+ os .makedirs (cpath )
1035
+
1036
+ scm_dir = '.' + self .scm .name
1037
+ if os .path .isdir (os .path .join (cpath , scm_dir )):
1038
+ rmtree_readonly (os .path .join (cpath , scm_dir ))
1039
+ shutil .copytree (os .path .join (self .path , scm_dir ), os .path .join (cpath , scm_dir ))
1040
+ except (IOError , OSError , WindowsError ):
1041
+ warning ("Unable to cache \" %s\" to \" %s\" " % (self .path , cpath ))
1039
1042
return False
1040
1043
1041
1044
def can_update (self , clean , force ):
0 commit comments