From fb37076d92c054b8f7daca88d85a2f209dd5fa1b Mon Sep 17 00:00:00 2001 From: Damian Wrobel Date: Mon, 11 Dec 2023 22:24:04 +0100 Subject: [PATCH] SyntaxWarning: invalid escape sequence '\d' Fixes the following syntax warning on python 3.12: lib/python/qtvcp/widgets/versa_probe.py:57: SyntaxWarning: invalid escape sequence '\d' self.valid = QtGui.QRegExpValidator(QtCore.QRegExp('^((\d{1,4}(\.\d{1,3})?)|(\.\d{1,3}))$')) lib/python/qtvcp/widgets/versa_probe.py:59: SyntaxWarning: invalid escape sequence '\d' self.valid = QtGui.QRegExpValidator(QtCore.QRegExp('^((\d{1,3}(\.\d{1,4})?)|(\.\d{1,4}))$')) Signed-off-by: Damian Wrobel --- lib/python/qtvcp/widgets/versa_probe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/qtvcp/widgets/versa_probe.py b/lib/python/qtvcp/widgets/versa_probe.py index 58b501a48c7..e308de74872 100644 --- a/lib/python/qtvcp/widgets/versa_probe.py +++ b/lib/python/qtvcp/widgets/versa_probe.py @@ -54,9 +54,9 @@ def __init__(self, parent=None): self.tool_number = None STATUS.connect('tool-info-changed', lambda w, data: self._tool_info(data)) if INFO.MACHINE_IS_METRIC: - self.valid = QtGui.QRegExpValidator(QtCore.QRegExp('^((\d{1,4}(\.\d{1,3})?)|(\.\d{1,3}))$')) + self.valid = QtGui.QRegExpValidator(QtCore.QRegExp(r'^((\d{1,4}(\.\d{1,3})?)|(\.\d{1,3}))$')) else: - self.valid = QtGui.QRegExpValidator(QtCore.QRegExp('^((\d{1,3}(\.\d{1,4})?)|(\.\d{1,4}))$')) + self.valid = QtGui.QRegExpValidator(QtCore.QRegExp(r'^((\d{1,3}(\.\d{1,4})?)|(\.\d{1,4}))$')) self.setMinimumSize(600, 420) # Load the widgets UI file will use local file if available: self.filename = PATH.find_widget_path('versa_probe.ui')