Skip to content

Commit

Permalink
Pokemon Emerald: Fix invalid escape sequence warnings
Browse files Browse the repository at this point in the history
Generation on Python 3.12 would print SyntaxWarnings due to invalid '\d'
escape sequences added in ArchipelagoMW#3832.

Use raw strings to avoid `\` being used to escape characters.
  • Loading branch information
Mysteryem committed Dec 3, 2024
1 parent ac8a206 commit a1ff10c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worlds/pokemon_emerald/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ def _init() -> None:
label = []
for word in map_name[4:].split("_"):
# 1F, B1F, 2R, etc.
re_match = re.match("^B?\d+[FRP]$", word)
re_match = re.match(r"^B?\d+[FRP]$", word)
if re_match:
label.append(word)
continue

# Route 103, Hall 1, House 5, etc.
re_match = re.match("^([A-Z]+)(\d+)$", word)
re_match = re.match(r"^([A-Z]+)(\d+)$", word)
if re_match:
label.append(re_match.group(1).capitalize())
label.append(re_match.group(2).lstrip("0"))
Expand Down

0 comments on commit a1ff10c

Please sign in to comment.