File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 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:
9999
100100def download_driver (zip_name : str ) -> None :
101101 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 ):
103104 return
104105 url = "https://playwright.azureedge.net/builds/driver/"
105106 if (
@@ -109,9 +110,11 @@ def download_driver(zip_name: str) -> None:
109110 ):
110111 url = url + "next/"
111112 url = url + zip_file
113+ temp_destination_path = destination_path + ".tmp"
112114 print (f"Fetching { url } " )
113115 # 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 )
115118
116119
117120class PlaywrightBDistWheelCommand (BDistWheelCommand ):
You can’t perform that action at this time.
0 commit comments