From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-s390x@nongnu.org, "Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Cc: qemu-devel@nongnu.org, Eric Farman <farman@linux.ibm.com>,
Cleber Rosa <crosa@redhat.com>,
Wainer dos Santos Moschetta <wainersm@redhat.com>,
Beraldo Leal <bleal@redhat.com>, John Snow <jsnow@redhat.com>
Subject: Re: [PATCH] tests/avocado/machine_s390_ccw_virtio.py: Fix SyntaxWarnings from python 3.12
Date: Mon, 13 Nov 2023 16:48:39 +0100 [thread overview]
Message-ID: <55daeff7-8595-4f9d-b69a-cbc02b42517e@redhat.com> (raw)
In-Reply-To: <2d938d82-d7ca-4cd1-b4eb-a24bc4b6c337@linaro.org>
On 13/11/2023 15.47, Philippe Mathieu-Daudé wrote:
> On 13/11/23 15:07, Thomas Huth wrote:
>> Python 3.12 now warns about backslashes in strings that aren't used
>> for escaping a special character from Python. Silence the warning
>> by using raw strings here instead.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> tests/avocado/machine_s390_ccw_virtio.py | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/tests/avocado/machine_s390_ccw_virtio.py
>> b/tests/avocado/machine_s390_ccw_virtio.py
>> index e1f493bc44..ffd914ded9 100644
>> --- a/tests/avocado/machine_s390_ccw_virtio.py
>> +++ b/tests/avocado/machine_s390_ccw_virtio.py
>> @@ -36,8 +36,8 @@ def wait_for_crw_reports(self):
>> dmesg_clear_count = 1
>> def clear_guest_dmesg(self):
>> exec_command_and_wait_for_pattern(self, 'dmesg -c > /dev/null; '
>> - 'echo dm_clear\ ' + str(self.dmesg_clear_count),
>> - 'dm_clear ' + str(self.dmesg_clear_count))
>> + r'echo dm_clear\ ' + str(self.dmesg_clear_count),
>> + r'dm_clear ' + str(self.dmesg_clear_count))
>> self.dmesg_clear_count += 1
>> def test_s390x_devices(self):
>> @@ -121,15 +121,15 @@ def test_s390x_devices(self):
>> 'cat
>> /sys/bus/ccw/devices/0.1.1111/cutype',
>> '3832/01')
>> exec_command_and_wait_for_pattern(self,
>> - 'cat
>> /sys/bus/pci/devices/0005\:00\:00.0/subsystem_vendor',
>> - '0x1af4')
>> + r'cat
>> /sys/bus/pci/devices/0005\:00\:00.0/subsystem_vendor',
>> + r'0x1af4')
>
> Do we really need to escape the hex number?
No, technically not, but it look kind of ugly to me if the strings that are
indented on the same level start with a different prefix, so I'd prefer to
keep them.
>
> Otherwise,
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks!
Thomas
next prev parent reply other threads:[~2023-11-13 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 14:07 [PATCH] tests/avocado/machine_s390_ccw_virtio.py: Fix SyntaxWarnings from python 3.12 Thomas Huth
2023-11-13 14:47 ` Philippe Mathieu-Daudé
2023-11-13 15:48 ` Thomas Huth [this message]
2023-11-13 16:12 ` Philippe Mathieu-Daudé
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=55daeff7-8595-4f9d-b69a-cbc02b42517e@redhat.com \
--to=thuth@redhat.com \
--cc=bleal@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=crosa@redhat.com \
--cc=farman@linux.ibm.com \
--cc=jsnow@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=wainersm@redhat.com \
/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).