* 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.33baorrhrh...@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.szczepa...@arm.com> Cc: Patrick Robb <pr...@iol.unh.edu> Cc: sta...@dpdk.org Suggested-by: Robin Jarry <rja...@redhat.com> Signed-off-by: Ariel Otilibili <otili...@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