Skip to content

Commit

Permalink
Use correct regex to avoid SyntaxWarning: invalid escape sequence '\.'
Browse files Browse the repository at this point in the history
Change-Id: I1c6179be294bf21c0897a3abf7e8ab1d270ae238
Signed-off-by: Galantsev, Dmitrii <[email protected]>
  • Loading branch information
Michael John authored and dmitrii-galantsev committed Sep 16, 2024
1 parent 9119927 commit d9ccc44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amdsmi_cli/BDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __contains__(self, passed_bdf):
"""Overrided the 'in' comparator in python"""
passed_bdf = str(BDF(passed_bdf))

bdf_regex = "(?:[0-6]?[0-9a-fA-F]{1,4}:)?[0-2]?[0-9a-fA-F]{1,2}:[0-9a-fA-F]{1,2}\.[0-7]"
bdf_regex = "(?:[0-6]?[0-9a-fA-F]{1,4}:)?[0-2]?[0-9a-fA-F]{1,2}:[0-9a-fA-F]{1,2}\\.[0-7]"
for match in re.findall(bdf_regex, passed_bdf):
if self == match:
return True
Expand Down

1 comment on commit d9ccc44

@ForyoungYu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same solution here:
bdf_regex = r"(?:[0-6]?[0-9a-fA-F]{1,4}:)?[0-2]?[0-9a-fA-F]{1,2}:[0-9a-fA-F]{1,2}.[0-7]"

Please sign in to comment.