python-sonic-client
python-sonic-client copied to clipboard
Fix SyntaxWarning: invalid escape sequence errors on Python 3.12
When using this library with Python 3.12, several warnings are displayed:
./.venv/lib/python3.12/site-packages/sonic/client.py:115: SyntaxWarning: invalid escape sequence '\('
matches = re.findall("protocol\((\w+)\)", text)
./.venv/lib/python3.12/site-packages/sonic/client.py:134: SyntaxWarning: invalid escape sequence '\('
matches = re.findall("buffer\((\w+)\)", text)
./.venv/lib/python3.12/site-packages/sonic/client.py:153: SyntaxWarning: invalid escape sequence '\w'
matches = re.findall("PENDING (\w+)", text)
This PR fixes the issue by making marking these strings as r'...' "raw" strings.