[PATCH 2/2] dts: clear out Python syntax warnings
Patrick Robb
probb at iol.unh.edu
Tue Dec 17 19:10:01 CET 2024
Reviewed-by: Patrick Robb
A question for main branch maintainers - should this series go directly to
the main branch? I don't think I should apply this to next-dts due to the
1/2 patch.
On Sat, Dec 14, 2024 at 5:43 AM Ariel Otilibili <otilibil at eurecom.fr> wrote:
> * follow up of a discussion with Robin Jarry
> * since 3.12 invalid escape sequences generate SyntaxWarning
> * in the future, these invalid sequences will generate SyntaxError
> * therefore changed syntax to raw string notation.
>
> Link: https://inbox.dpdk.org/dev/D6AMQXRSG8E7.33BAORRHRHV9A@redhat.com/
> Link: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
> Fixes: 99740300890 ("dts: use Python shell for Scapy instead of XML-RPC")
> Fixes: 409359adce4 ("dts: fix smoke tests driver regex")
>
> Cc: Paul Szczepanek <paul.szczepanek at arm.com>
> Cc: Patrick Robb <probb at iol.unh.edu>
> Cc: stable at dpdk.org
> Suggested-by: Robin Jarry <rjarry at redhat.com>
> Signed-off-by: Ariel Otilibili <otilibil at eurecom.fr>
> ---
> dts/framework/testbed_model/traffic_generator/scapy.py | 2 +-
> dts/tests/TestSuite_smoke_tests.py | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py
> b/dts/framework/testbed_model/traffic_generator/scapy.py
> index 1251ca65a0..f42f663554 100644
> --- a/dts/framework/testbed_model/traffic_generator/scapy.py
> +++ b/dts/framework/testbed_model/traffic_generator/scapy.py
> @@ -234,6 +234,6 @@ def _shell_start_and_stop_sniffing(self, duration:
> float) -> list[Packet]:
> )
> # In the string of bytes "b'XXXX'", we only want the contents
> ("XXXX")
> list_of_packets_base64 = re.findall(
> - f"^b'({REGEX_FOR_BASE64_ENCODING})'", packet_strs,
> re.MULTILINE
> + fr"^b'({REGEX_FOR_BASE64_ENCODING})'", packet_strs,
> re.MULTILINE
> )
> return [Ether(base64_bytes(pakt)) for pakt in
> list_of_packets_base64]
> diff --git a/dts/tests/TestSuite_smoke_tests.py
> b/dts/tests/TestSuite_smoke_tests.py
> index bc3a2a6bf9..a029a564eb 100644
> --- a/dts/tests/TestSuite_smoke_tests.py
> +++ b/dts/tests/TestSuite_smoke_tests.py
> @@ -136,7 +136,7 @@ def test_device_bound_to_driver(self) -> None:
> # with the address for the nic we are on in the loop and then
> captures the
> # name of the driver in a group
> devbind_info_for_nic = re.search(
> - f"{nic.pci}[^\\n]*drv=([\\d\\w-]*) [^\\n]*",
> + fr"{nic.pci}[^\\n]*drv=([\\d\\w-]*) [^\\n]*",
> all_nics_in_dpdk_devbind,
> )
> self.verify(
> --
> 2.47.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/stable/attachments/20241217/c46cf31d/attachment.htm>
More information about the stable
mailing list