qemu-iotests: Simplify FilePath __init__

Use list comprehension instead of append loop.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200828232152.205833-6-nsoffer@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Nir Soffer
2020-09-15 11:05:12 +02:00
committed by Max Reitz
parent 3192fad7f7
commit 7cc002a06c
+2 -3
View File
@@ -470,9 +470,8 @@ class FilePath:
"""
def __init__(self, *names, base_dir=test_dir):
self.paths = []
for name in names:
self.paths.append(os.path.join(base_dir, file_pattern(name)))
self.paths = [os.path.join(base_dir, file_pattern(name))
for name in names]
def __enter__(self):
if len(self.paths) == 1: