summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/info.py2
-rw-r--r--lib/spack/spack/cmd/style.py2
-rw-r--r--lib/spack/spack/test/cmd/dependencies.py14
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py
index fa674317ab..9c9c0faee2 100644
--- a/lib/spack/spack/cmd/info.py
+++ b/lib/spack/spack/cmd/info.py
@@ -111,7 +111,7 @@ class VariantFormatter(object):
yield ' None'
else:
yield ' ' + self.fmt % self.headers
- underline = tuple([l * "=" for l in self.column_widths])
+ underline = tuple([w * "=" for w in self.column_widths])
yield ' ' + self.fmt % underline
yield ''
for k, v in sorted(self.variants.items()):
diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py
index 62a7b72d8e..9b72849c28 100644
--- a/lib/spack/spack/cmd/style.py
+++ b/lib/spack/spack/cmd/style.py
@@ -183,6 +183,8 @@ def rewrite_and_print_output(
)
for line in output.split("\n"):
+ if not line:
+ continue
print(
re_obj.sub(
cwd_relative,
diff --git a/lib/spack/spack/test/cmd/dependencies.py b/lib/spack/spack/test/cmd/dependencies.py
index 05d0556936..8518f2e80d 100644
--- a/lib/spack/spack/test/cmd/dependencies.py
+++ b/lib/spack/spack/test/cmd/dependencies.py
@@ -51,8 +51,11 @@ def test_direct_installed_dependencies(mock_packages, database):
with color_when(False):
out = dependencies('--installed', 'mpileaks^mpich')
- lines = [l for l in out.strip().split('\n') if not l.startswith('--')]
- hashes = set([re.split(r'\s+', l)[0] for l in lines])
+ lines = [
+ line for line in out.strip().split('\n')
+ if not line.startswith('--')
+ ]
+ hashes = set([re.split(r'\s+', line)[0] for line in lines])
expected = set([spack.store.db.query_one(s).dag_hash(7)
for s in ['mpich', 'callpath^mpich']])
@@ -65,8 +68,11 @@ def test_transitive_installed_dependencies(mock_packages, database):
with color_when(False):
out = dependencies('--installed', '--transitive', 'mpileaks^zmpi')
- lines = [l for l in out.strip().split('\n') if not l.startswith('--')]
- hashes = set([re.split(r'\s+', l)[0] for l in lines])
+ lines = [
+ line for line in out.strip().split('\n')
+ if not line.startswith('--')
+ ]
+ hashes = set([re.split(r'\s+', line)[0] for line in lines])
expected = set([spack.store.db.query_one(s).dag_hash(7)
for s in ['zmpi', 'callpath^zmpi', 'fake',