From: Nir Soffer <nirsof@gmail.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, John Snow <jsnow@redhat.com>,
Max Reitz <mreitz@redhat.com>, Nir Soffer <nsoffer@redhat.com>
Subject: [PATCH v2 5/5] qemu-iotests: Simplify FilePath __init__
Date: Fri, 21 Aug 2020 02:54:27 +0300 [thread overview]
Message-ID: <20200820235427.374645-6-nsoffer@redhat.com> (raw)
In-Reply-To: <20200820235427.374645-1-nsoffer@redhat.com>
Use list comprehension instead of append loop.
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
---
tests/qemu-iotests/iotests.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1b5cdd493e..7ebd0bcc92 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -467,9 +467,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:
--
2.26.2
next prev parent reply other threads:[~2020-08-20 23:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 23:54 [PATCH v2 0/5] iotest.FilePath fixes and cleanups Nir Soffer
2020-08-20 23:54 ` [PATCH v2 1/5] qemu-iotests: Fix FilePaths cleanup Nir Soffer
2020-08-25 10:27 ` Max Reitz
2020-08-20 23:54 ` [PATCH v2 2/5] qemu-iotests: Fix FilePaths docstring Nir Soffer
2020-08-25 10:39 ` Max Reitz
2020-08-25 10:48 ` Max Reitz
2020-08-25 11:17 ` Nir Soffer
2020-08-20 23:54 ` [PATCH v2 3/5] qemu-iotests: Support varargs syntax in FilePaths Nir Soffer
2020-08-25 10:48 ` Max Reitz
2020-08-20 23:54 ` [PATCH v2 4/5] qemu-iotests: Merge FilePaths and FilePath Nir Soffer
2020-08-25 10:57 ` Max Reitz
2020-08-20 23:54 ` Nir Soffer [this message]
2020-08-25 10:58 ` [PATCH v2 5/5] qemu-iotests: Simplify FilePath __init__ Max Reitz
2020-08-25 11:37 ` [PATCH v2 0/5] iotest.FilePath fixes and cleanups Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200820235427.374645-6-nsoffer@redhat.com \
--to=nirsof@gmail.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=nsoffer@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).