Skip to content

Commit 525e8c8

Browse files
authored
Merge pull request #1261 from Sage-Bionetworks/fix_regex_deprecation_warning
fix deprecation warnign by changing regex string to raw strings
2 parents e170e6f + 9f1b13d commit 525e8c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

synapseclient/models/schema_organization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ def _check_semantic_version(self, version: str) -> None:
12371237
"""
12381238
if version == "0.0.0":
12391239
raise ValueError("Schema version must start at '0.0.1' or higher")
1240-
if not re.match("^(\d+)\.(\d+)\.(\d+)$", version):
1240+
if not re.match(r"^(\d+)\.(\d+)\.(\d+)$", version):
12411241
raise ValueError(
12421242
(
12431243
"Schema version must be a semantic version with no letters "
@@ -1328,7 +1328,7 @@ def _check_semantic_version(self, version: str) -> None:
13281328
Raises:
13291329
ValueError: If the string is not a correct semantic version
13301330
"""
1331-
if not re.match("^(\d+)\.(\d+)\.(\d*)$", version) or version == "0.0.0":
1331+
if not re.match(r"^(\d+)\.(\d+)\.(\d*)$", version) or version == "0.0.0":
13321332
raise ValueError(
13331333
(
13341334
"Schema version must be a semantic version starting at 0.0.1 with no letters "
@@ -1418,7 +1418,7 @@ def _check_name(name: str) -> None:
14181418
raise ValueError(f"The name must not contain 'sagebionetworks' : {name}")
14191419
parts = name.split(".")
14201420
for part in parts:
1421-
if not re.match("^([A-Za-z])([A-Za-z]|\d|)*$", part):
1421+
if not re.match(r"^([A-Za-z])([A-Za-z]|\d|)*$", part):
14221422
raise ValueError(
14231423
(
14241424
"Name may be separated by periods, "

0 commit comments

Comments
 (0)