File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,8 @@ def extractall(zip: zipfile.ZipFile, path: str) -> None:
99
99
100
100
def download_driver (zip_name : str ) -> None :
101
101
zip_file = f"playwright-{ driver_version } -{ zip_name } .zip"
102
- if os .path .exists ("driver/" + zip_file ):
102
+ destination_path = "driver/" + zip_file
103
+ if os .path .exists (destination_path ):
103
104
return
104
105
url = "https://playwright.azureedge.net/builds/driver/"
105
106
if (
@@ -109,9 +110,11 @@ def download_driver(zip_name: str) -> None:
109
110
):
110
111
url = url + "next/"
111
112
url = url + zip_file
113
+ temp_destination_path = destination_path + ".tmp"
112
114
print (f"Fetching { url } " )
113
115
# Don't replace this with urllib - Python won't have certificates to do SSL on all platforms.
114
- subprocess .check_call (["curl" , url , "-o" , "driver/" + zip_file ])
116
+ subprocess .check_call (["curl" , url , "-o" , temp_destination_path ])
117
+ os .rename (temp_destination_path , destination_path )
115
118
116
119
117
120
class PlaywrightBDistWheelCommand (BDistWheelCommand ):
You can’t perform that action at this time.
0 commit comments