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-08-29 02:21:52 +03:00 committed by Max Reitz
parent 3192fad7f7
commit 7cc002a06c
1 changed files with 2 additions and 3 deletions

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: