]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kselftest/devices/probe: Fix SyntaxWarning in regex strings for Python3
authorAlessandro Zanni <alessandro.zanni87@gmail.com>
Tue, 6 Aug 2024 12:14:50 +0000 (14:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:42 +0000 (12:00 +0200)
commitd6713af2395e3b6b4064199d0b9c74b74f500506
tree548a3e1735efb76987238fa4bf846234c096a861
parentb8f27f7c447ae67591d2c3ce0f20383e06241fc4
kselftest/devices/probe: Fix SyntaxWarning in regex strings for Python3

[ Upstream commit a19008256d05e726f29f43c6a307e45482c082c3 ]

Insert raw strings to prevent Python3 from interpreting string literals
as Unicode strings and "\d" as invalid escaped sequence.

Fix the warnings:

tools/testing/selftests/devices/probe/test_discoverable_devices.py:48:
SyntaxWarning: invalid escape sequence '\d' usb_controller_sysfs_dir =
"usb[\d]+"

tools/testing/selftests/devices/probe/test_discoverable_devices.py: 94:
SyntaxWarning: invalid escape sequence '\d' re_usb_version =
re.compile("PRODUCT=.*/(\d)/.*")

Fixes: dacf1d7a78bf ("kselftest: Add test to verify probe of devices from discoverable buses")
Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/devices/test_discoverable_devices.py