mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47: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
|
@ -338,7 +338,7 @@ class PauseAtHeight(Script):
|
|||
nbr_negative_layers += 1
|
||||
|
||||
#Track the latest printing temperature in order to resume at the correct temperature.
|
||||
if re.match("T(\d*)", line):
|
||||
if re.match(r"T(\d*)", line):
|
||||
current_t = self.getValue(line, "T")
|
||||
m = self.getValue(line, "M")
|
||||
if m is not None and (m == 104 or m == 109) and self.getValue(line, "S") is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue