mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Use raw strings for regular expressions with invalid escape sequences
If "T(\d*)" was "T(\n*)" it would search for newlines. There isn't any such \d escape character. It should be "T(\\d*)" or r"T(\d*)" going with the latter, to be easier to read and be consistent with other Cura usage. Start python with -Wd or for python 3.12 will raise a SyntaxWarning.
This commit is contained in:
parent
38695d9572
commit
6e3e3e6742
4 changed files with 4 additions and 4 deletions
|
@ -122,7 +122,7 @@ class Script:
|
|||
if not key in line or (';' in line and line.find(key) > line.find(';')):
|
||||
return default
|
||||
sub_part = line[line.find(key) + 1:]
|
||||
m = re.search('^-?[0-9]+\.?[0-9]*', sub_part)
|
||||
m = re.search(r'^-?[0-9]+\.?[0-9]*', sub_part)
|
||||
if m is None:
|
||||
return default
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue