@@ -180,8 +180,7 @@ def get_version_history(bazelisk_directory):
180180 ),
181181 # This only handles versions with numeric components, but that is fine
182182 # since prerelease versions have been excluded.
183- key = lambda version : tuple (int (component )
184- for component in version .split ('.' )),
183+ key = lambda version : tuple (int (component ) for component in version .split ("." )),
185184 reverse = True ,
186185 )
187186
@@ -308,8 +307,8 @@ def download_bazel_into_directory(version, is_commit, directory):
308307
309308 sha256_path = destination_path + ".sha256"
310309 expected_hash = ""
311- matcher = re .compile (r"(\d*\.\d*(?:\.\d*)?)(rc\d+)?" )
312- matched = matcher .match (version )
310+ matcher = re .compile (r"(\d*\.\d*(?:\.\d*)?)(rc\d+)?" )
311+ matched = matcher .match (version )
313312 if not os .path .exists (sha256_path ):
314313 try :
315314 download (bazel_url + ".sha256" , sha256_path )
@@ -322,13 +321,13 @@ def download_bazel_into_directory(version, is_commit, directory):
322321 return destination_path
323322 if matched :
324323 (version , rc ) = matched .groups ()
325- fallback_url = "https://releases.bazel.build/{}/{}/{}" .format (
324+ fallback_url = "https://releases.bazel.build/{}/{}/{}" .format (
326325 version , rc if rc else "release" , bazel_filename
327326 )
328327 try :
329328 download ("{}.sha256" .format (fallback_url ), sha256_path )
330329 os .remove (destination_path )
331- download (fallback_url ,destination_path )
330+ download (fallback_url , destination_path )
332331 except HTTPError :
333332 return destination_path
334333 os .chmod (destination_path , 0o755 )
@@ -350,12 +349,12 @@ def download_bazel_into_directory(version, is_commit, directory):
350349 )
351350 if matched :
352351 (version , rc ) = matched .groups ()
353- fallback_url = "https://releases.bazel.build/{}/{}/{}" .format (
352+ fallback_url = "https://releases.bazel.build/{}/{}/{}" .format (
354353 version , rc if rc else "release" , bazel_filename
355354 )
356355 try :
357356 download ("{}.sha256" .format (fallback_url ), sha256_path )
358- download (fallback_url ,destination_path )
357+ download (fallback_url , destination_path )
359358 except HTTPError :
360359 exit (22 )
361360 os .chmod (destination_path , 0o755 )
0 commit comments