diff options
| author | binarycat <binarycat@envs.net> | 2024-08-23 11:48:04 -0400 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2024-08-23 11:57:23 -0400 |
| commit | 69ca95bf7f5462eb7ade2de18d1f0d79b2c21cfd (patch) | |
| tree | f951f9e1db28d094af0dfa0865056bfc70dc95a5 /src/bootstrap/bootstrap.py | |
| parent | d1b41f3747ecb01b717bd50918513227de36f3cb (diff) | |
| download | rust-69ca95bf7f5462eb7ade2de18d1f0d79b2c21cfd.tar.gz rust-69ca95bf7f5462eb7ade2de18d1f0d79b2c21cfd.zip | |
use tuples for semver, not floats
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 5ea4b4882a9..c19134b4594 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -80,7 +80,10 @@ def get(base, url, path, checksums, verbose=False): os.unlink(temp_path) def curl_version(): - return float(re.match(bytes("^curl ([0-9]+\\.[0-9]+)", "utf8"), require(["curl", "-V"]))[1]) + m = re.match(bytes("^curl ([0-9]+)\\.([0-9]+)", "utf8"), require(["curl", "-V"])) + if m is None: + return (0, 0) + return (int(m[1]), int(m[2])) def download(path, url, probably_big, verbose): for _ in range(4): @@ -110,7 +113,7 @@ def _download(path, url, probably_big, verbose, exception): # but raise `CalledProcessError` or `OSError` instead require(["curl", "--version"], exception=platform_is_win32()) extra_flags = [] - if curl_version() > 7.70: + if curl_version() > (7, 70): extra_flags = [ "--retry-all-errors" ] run(["curl", option] + extra_flags + [ "-L", # Follow redirect. |
