mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 22:16:41 +00:00
Fix python 3.12 SyntaxWarning (#4045)
Regular expressions now need to be double-escaped: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
This commit is contained in:
@@ -34,7 +34,7 @@ class IfcGit:
|
|||||||
working_dir = repo.working_dir
|
working_dir = repo.working_dir
|
||||||
for item in os.listdir(working_dir):
|
for item in os.listdir(working_dir):
|
||||||
path = os.path.join(working_dir, item)
|
path = os.path.join(working_dir, item)
|
||||||
if os.path.isfile(path) and re.match(".*\.ifc$", path, re.IGNORECASE):
|
if os.path.isfile(path) and re.match(".*\\.ifc$", path, re.IGNORECASE):
|
||||||
cls.load_project(path)
|
cls.load_project(path)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@@ -202,7 +202,7 @@ class IfcGit:
|
|||||||
"""Check a bare branch or tag name is valid"""
|
"""Check a bare branch or tag name is valid"""
|
||||||
|
|
||||||
return re.match(
|
return re.match(
|
||||||
"^(?!\.| |-|/)((?!\.\.)(?!.*/\.)(/\*|/\*/)*(?!@\{)[^\~\:\^\\\ \?*\[])+(?<!\.|/)(?<!\.lock)$",
|
"^(?!\\.| |-|/)((?!\\.\\.)(?!.*/\\.)(/\\*|/\\*/)*(?!@\\{)[^\\~\\:\\^\\\\ \\?*\\[])+(?<!\\.|/)(?<!\\.lock)$",
|
||||||
string,
|
string,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user