Skip to content

Commit 5face71

Browse files
committed
Fix python 3.12 SyntaxWarning (IfcOpenShell#4045)
Regular expressions now need to be double-escaped: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
1 parent 434a11a commit 5face71

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/blenderbim/blenderbim/tool/ifcgit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def load_anyifc(cls, repo):
3434
working_dir = repo.working_dir
3535
for item in os.listdir(working_dir):
3636
path = os.path.join(working_dir, item)
37-
if os.path.isfile(path) and re.match(".*\.ifc$", path, re.IGNORECASE):
37+
if os.path.isfile(path) and re.match(".*\\.ifc$", path, re.IGNORECASE):
3838
cls.load_project(path)
3939
return True
4040
return False
@@ -202,7 +202,7 @@ def is_valid_ref_format(cls, string):
202202
"""Check a bare branch or tag name is valid"""
203203

204204
return re.match(
205-
"^(?!\.| |-|/)((?!\.\.)(?!.*/\.)(/\*|/\*/)*(?!@\{)[^\~\:\^\\\ \?*\[])+(?<!\.|/)(?<!\.lock)$",
205+
"^(?!\\.| |-|/)((?!\\.\\.)(?!.*/\\.)(/\\*|/\\*/)*(?!@\\{)[^\\~\\:\\^\\\\ \\?*\\[])+(?<!\\.|/)(?<!\\.lock)$",
206206
string,
207207
)
208208

0 commit comments

Comments
 (0)