@@ -1146,12 +1146,15 @@ def do_custom_build(self):
1146
1146
os .path .isfile (tarball_cache_path )):
1147
1147
if get_file_hash (tarball_cache_path ) == LOCAL_FREETYPE_HASH :
1148
1148
try :
1149
- # fail on Lpy, oh well
1150
- os .makedirs ('build' , exist_ok = True )
1149
+ os .makedirs ('build' )
1150
+ except OSError :
1151
+ # Don't care if it exists.
1152
+ pass
1153
+ try :
1151
1154
shutil .copy (tarball_cache_path , tarball_path )
1152
1155
print ('Using cached tarball: {}'
1153
1156
.format (tarball_cache_path ))
1154
- except :
1157
+ except OSError :
1155
1158
# If this fails, oh well just re-download
1156
1159
pass
1157
1160
@@ -1165,12 +1168,12 @@ def do_custom_build(self):
1165
1168
os .makedirs ('build' )
1166
1169
1167
1170
sourceforge_url = (
1168
- 'http ://downloads.sourceforge.net/project/freetype'
1171
+ 'https ://downloads.sourceforge.net/project/freetype'
1169
1172
'/freetype2/{0}/' .format (LOCAL_FREETYPE_VERSION )
1170
1173
)
1171
1174
url_fmts = (
1172
1175
sourceforge_url + '{0}' ,
1173
- 'http ://download.savannah.gnu.org/releases/freetype/{0}'
1176
+ 'https ://download.savannah.gnu.org/releases/freetype/{0}'
1174
1177
)
1175
1178
for url_fmt in url_fmts :
1176
1179
tarball_url = url_fmt .format (tarball )
@@ -1186,12 +1189,15 @@ def do_custom_build(self):
1186
1189
raise IOError ("Failed to download freetype" )
1187
1190
if get_file_hash (tarball_path ) == LOCAL_FREETYPE_HASH :
1188
1191
try :
1189
- # this will fail on LPy, oh well
1190
- os .makedirs (tarball_cache_dir , exist_ok = True )
1192
+ os .makedirs (tarball_cache_dir )
1193
+ except OSError :
1194
+ # Don't care if it exists.
1195
+ pass
1196
+ try :
1191
1197
shutil .copy (tarball_path , tarball_cache_path )
1192
1198
print ('Cached tarball at: {}'
1193
1199
.format (tarball_cache_path ))
1194
- except :
1200
+ except OSError :
1195
1201
# again, we do not care if this fails, can
1196
1202
# always re download
1197
1203
pass
0 commit comments