From 3998249ae77f3a6e1c6e44de944e9d5928963594 Mon Sep 17 00:00:00 2001 From: Chris Simpkins Date: Fri, 7 Feb 2020 22:00:25 -0500 Subject: remove unnecessary local variable assignment in context manager --- src/bootstrap/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 1935759a562..563f12e7bac 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -351,7 +351,7 @@ class RustBuild(object): try: with tempfile.NamedTemporaryFile(delete=False) as temp_file: temp_path = temp_file.name - with tarfile.open(temp_path, "w:xz") as tar: + with tarfile.open(temp_path, "w:xz"): pass return True except tarfile.CompressionError: -- cgit 1.4.1-3-g733a5 From 19aaf639459705e2b397f2b8a12f3d73ef0748b2 Mon Sep 17 00:00:00 2001 From: Chris Simpkins Date: Fri, 7 Feb 2020 22:04:44 -0500 Subject: PEP8 format spacing --- src/bootstrap/bootstrap.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 563f12e7bac..50e1726240f 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -80,7 +80,7 @@ def _download(path, url, probably_big, verbose, exception): option = "-s" run(["curl", option, "-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds - "--connect-timeout", "30", # timeout if cannot connect within 30 seconds + "--connect-timeout", "30", # timeout if cannot connect within 30 seconds "--retry", "3", "-Sf", "-o", path, url], verbose=verbose, exception=exception) @@ -332,7 +332,6 @@ class RustBuild(object): self.use_vendored_sources = '' self.verbose = False - def download_stage0(self): """Fetch the build system for Rust, written in Rust @@ -825,7 +824,7 @@ class RustBuild(object): if not os.path.exists(vendor_dir): print('error: vendoring required, but vendor directory does not exist.') print(' Run `cargo vendor` without sudo to initialize the ' - 'vendor directory.') + 'vendor directory.') raise Exception("{} not found".format(vendor_dir)) if self.use_vendored_sources: @@ -839,7 +838,7 @@ class RustBuild(object): "\n" "[source.vendored-sources]\n" "directory = '{}/vendor'\n" - .format(self.rust_root)) + .format(self.rust_root)) else: if os.path.exists('.cargo'): shutil.rmtree('.cargo') -- cgit 1.4.1-3-g733a5 From 6ce8d2b00005143d5f0fb0c9b712ece7709b3ecf Mon Sep 17 00:00:00 2001 From: Chris Simpkins Date: Fri, 7 Feb 2020 22:09:55 -0500 Subject: PEP8 format spacing --- src/bootstrap/configure.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 7cfc5385e21..27bd6d028cd 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -392,11 +392,12 @@ for target in configured_targets: def is_number(value): - try: - float(value) - return True - except ValueError: - return False + try: + float(value) + return True + except ValueError: + return False + # Here we walk through the constructed configuration we have from the parsed # command line arguments. We then apply each piece of configuration by -- cgit 1.4.1-3-g733a5