Use regex literal instead of normal literal for regex

Hopefully this fixes the deprecation warning in newer Python versions.

Contributes to issue #6114.
This commit is contained in:
Ghostkeeper 2019-08-08 09:46:04 +02:00
parent 2d4fd5649d
commit 648999e32b
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

View File

@ -75,7 +75,7 @@ class CuraContainerRegistry(ContainerRegistry):
# \return \type{string} Name that is unique for the specified type and name/id # \return \type{string} Name that is unique for the specified type and name/id
def createUniqueName(self, container_type: str, current_name: str, new_name: str, fallback_name: str) -> str: def createUniqueName(self, container_type: str, current_name: str, new_name: str, fallback_name: str) -> str:
new_name = new_name.strip() new_name = new_name.strip()
num_check = re.compile("(.*?)\s*#\d+$").match(new_name) num_check = re.compile(r"(.*?)\s*#\d+$").match(new_name)
if num_check: if num_check:
new_name = num_check.group(1) new_name = num_check.group(1)
if new_name == "": if new_name == "":