Skip to content

Commit

Permalink
SyntaxWarning: invalid escape sequence '\d'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dwrobel committed Dec 11, 2023
1 parent cac8b1b commit fb37076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/qtvcp/widgets/versa_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit fb37076

Please sign in to comment.