39
39
import tarfile
40
40
import urllib3
41
41
import zipfile
42
+ from contextlib import suppress
42
43
from seleniumbase .fixtures import constants
43
44
from seleniumbase .fixtures import shared_utils
44
45
from seleniumbase import config as sb_config
@@ -1200,7 +1201,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
1200
1201
driver_path = None
1201
1202
driver_file = None
1202
1203
base_path = os .sep .join (zip_file_path .split (os .sep )[:- 1 ])
1203
- folder_name = contents [0 ].split (os . sep )[0 ]
1204
+ folder_name = contents [0 ].split ("/" )[0 ]
1204
1205
folder_path = os .path .join (base_path , folder_name )
1205
1206
if IS_MAC or IS_LINUX :
1206
1207
if (
@@ -1221,12 +1222,14 @@ def main(override=None, intel_for_uc=None, force_uc=None):
1221
1222
zip_file_path ,
1222
1223
"-DestinationPath" ,
1223
1224
downloads_folder ,
1225
+ "-Force" ,
1224
1226
]
1225
1227
)
1226
1228
else :
1227
1229
zip_ref .extractall (downloads_folder )
1228
1230
zip_ref .close ()
1229
- os .remove (zip_file_path )
1231
+ with suppress (Exception ):
1232
+ os .remove (zip_file_path )
1230
1233
log_d ("%sUnzip Complete!%s\n " % (c2 , cr ))
1231
1234
pr_base_path = c3 + base_path + cr
1232
1235
pr_sep = c3 + os .sep + cr
@@ -1240,7 +1243,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
1240
1243
driver_path = None
1241
1244
driver_file = None
1242
1245
base_path = os .sep .join (zip_file_path .split (os .sep )[:- 1 ])
1243
- folder_name = contents [0 ].split (os . sep )[0 ]
1246
+ folder_name = contents [0 ].split ("/" )[0 ]
1244
1247
folder_path = os .path .join (base_path , folder_name )
1245
1248
if IS_MAC or IS_LINUX :
1246
1249
if (
@@ -1261,12 +1264,14 @@ def main(override=None, intel_for_uc=None, force_uc=None):
1261
1264
zip_file_path ,
1262
1265
"-DestinationPath" ,
1263
1266
downloads_folder ,
1267
+ "-Force" ,
1264
1268
]
1265
1269
)
1266
1270
else :
1267
1271
zip_ref .extractall (downloads_folder )
1268
1272
zip_ref .close ()
1269
- os .remove (zip_file_path )
1273
+ with suppress (Exception ):
1274
+ os .remove (zip_file_path )
1270
1275
log_d ("%sUnzip Complete!%s\n " % (c2 , cr ))
1271
1276
pr_base_path = c3 + base_path + cr
1272
1277
pr_sep = c3 + os .sep + cr
0 commit comments